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
The diff method does not appear to compare strings properly if a string has been overwritten into a node that already had a longer string. I assume that it saw that it did not have to reallocate and it stores "quad\0" into the existing buffer. Then diff() subtracts 1 off the end of the char buffer length but that does not reflect the length of the string. So, we end up comparing "quad" vs "quad\0on" and the comparison fails.
Can the code encounter non-null terminated strings? Is that why it's even passing a length to std::string?
If we change to the typical std::string(const char*) constructor (ignoring any lengths) it works - but my strings are null terminated.
node["elements/shape"] = "polygon";
// some other logic
node["elements/shape"] = "quad";
Then I called some code in a test to compare my in-memory value to a baseline read by relay.
The diff method does not appear to compare strings properly if a string has been overwritten into a node that already had a longer string. I assume that it saw that it did not have to reallocate and it stores "quad\0" into the existing buffer. Then diff() subtracts 1 off the end of the char buffer length but that does not reflect the length of the string. So, we end up comparing "quad" vs "quad\0on" and the comparison fails.
Then I called some code in a test to compare my in-memory value to a baseline read by relay.
The text was updated successfully, but these errors were encountered: