Comments (4)
Hi, thank you for the bug report. This issue is now resolved in version 18.1.3
from zpl.
@zpl-zak thank you for taking a look at the issue. I think sadly your change is not correct/safe.
When parsing the root (or any object) the node is initially created on the stack
zpl/code/source/parsers/json.c
Line 205 in d80f610
node
is then passed into zpl__json_parse_value
as a pointer to the stack variable so in later calls obj
is still a pointer to the stack.
node
isn't allocated from the allocator until the zpl_array_append
call but all the child elements have the wrong parent at this point.
This is why I wrote the slightly obscure zpl_array_append_adt_node
which retrospectively corrects the parent of all children.
I think my diagnosis is correct and it helps I seem to get incorrect results with your version (the parent nodes stop having names as they got zero-ed out by stack reuse)
from zpl.
Thanks for the feedback; I'll be able to get back to it during the weekend. ๐๐ป
from zpl.
I had a look at it again, hopefully https://github.com/zpl-c/zpl/releases/tag/18.1.5 should resolve this issue now.
from zpl.
Related Issues (20)
- zpl_opts module should make use of ADT parser to process input HOT 1
- ADT URL parser addition
- Off-by-one in zpl_json_write_string/zpl_csv_write_string_delimiter HOT 1
- Result of zpl_alloc() is often not checked HOT 16
- Completion of error handling HOT 4
- zpl_array_fill ZPL_ASSERT error HOT 1
- zpl_opts_load_adt: allows the ability to load ADT node to fulfill CLI options
- ADT parsing of 'x' results in a ZPL_ADT_TYPE_INTEGER HOT 4
- `zpl_file_open` and functions that call it do not error when passed a directory HOT 5
- `name` and `string` fields of `zpl_json_object` have garbage values for `$schema` key HOT 6
- zpl_thread join/is_running
- Unicode support HOT 2
- pthread_join must be called for PTHREAD_CREATE_JOINABLE thread
- add 'zpl_semaphore_trywait'
- Undecorated 'cast' macro in helpers.h HOT 1
- Provide a way to free memory with the provided size HOT 5
- Global-buffer-overflow in zpl_strlcpyย ย in base64_enc HOT 2
- CSV parser assumes (unquoted) IP addresses are floating point HOT 3
- zpl_random_gen_isize / zpl_random_range_isize are not 32bit safe HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zpl.