To reproduce, I built the code 'examples' with the following command on my mac: cd examples clang test_json.c ../json.c -I ../ -fsanitize=undefined Then when I run: ./a.out ../tests/valid-0000.json I get this runtime warning: ../json.c:437:34: runtime error: applying non-zero offset 8 to null pointer It seems to work if I replace in the code the line: json_car **char = (json_char **) &top->u.object.values; by: intptr_t *chars = (intptr_t *) &top->u.object.values;