You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure whether this is a real bug or undefined behaviour, it's related to referencing a subkey which doesn't exist including its parent.
My understanding is that when I try to do a C++ reference of a json object , if the key doesn't exist it will insert the key
and give back the reference of it.
In my example I have a main object json js = null;
Now I am trying to do json& newJs = js["key1"]["key2"];
Later when I try to insert some object to this newJs, it crashes.
I overcame this issue by doing first js["key1"]["key2"] = null and then giving reference of it.
If you think this is not an undefined behaviour, I will try to replicate the issue in simpler code.
The text was updated successfully, but these errors were encountered:
I am not sure whether this is a real bug or undefined behaviour, it's related to referencing a subkey which doesn't exist including its parent.
My understanding is that when I try to do a C++ reference of a json object , if the key doesn't exist it will insert the key
and give back the reference of it.
In my example I have a main object
json js = null;
Now I am trying to do
json& newJs = js["key1"]["key2"];
Later when I try to insert some object to this newJs, it crashes.
I overcame this issue by doing first
js["key1"]["key2"] = null
and then giving reference of it.If you think this is not an undefined behaviour, I will try to replicate the issue in simpler code.
The text was updated successfully, but these errors were encountered: