Changeset b86f37d for lib


Ignore:
Timestamp:
2022-08-22T14:48:16Z (2 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
e9eee04
Parents:
b9572c1
git-author:
Petr Vaněk <arkamar@…> (29-07-22 12:32:01)
git-committer:
Jelmer Vernooij <jelmer@…> (22-08-22 14:48:16)
Message:

Fix error type-punned pointer warning

Dereferencing type-punned pointer will break strict-aliasing rules

Based on upstream[1] commits.

[1] https://github.com/json-parser/json-parser

Based-on: 161dff8321df ("Fix error type-punned pointer warning")
Based-on: d7b67db02aaa ("Fix error type-punned pointer warning")
Bug: https://bugs.gentoo.org/861371
Signed-off-by: Petr Vaněk <arkamar@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/json.c

    rb9572c1 rb86f37d  
    140140                        }
    141141
    142                         value->_reserved.object_mem = (*(char **) &value->u.object.values) + values_size;
     142                        value->_reserved.object_mem = (void *) (((char *) value->u.object.values) + values_size);
    143143
    144144                        value->u.object.length = 0;
     
    407407
    408408                                                if (state.first_pass) {
    409                                                         (*(json_char **) &top->u.object.values) += string_length + 1;
     409                                                        json_char **chars = (json_char **) &top->u.object.values;
     410                                                        chars[0] += string_length + 1;
    410411                                                } else {
    411412                                                        top->u.object.values [top->u.object.length].name
Note: See TracChangeset for help on using the changeset viewer.