Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions external_libs/json/jsoncpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ bool Reader::readValue() {
break;
case tokenNull:
{
Value v;
Value v(0);
Copy link

@emmanuel-deloget emmanuel-deloget Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Value exists with a default ctor (one that takes nullValue by default) this is not, IMHO, the right change. The default ctor shall be changed so that it correctly initialize all the Value properties when called (this is not done if it's called without any parameter or if it's called with vtype = nullValue).

The same goes for the other occurences of the same change.

currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
Expand All @@ -438,7 +438,7 @@ bool Reader::readValue() {
// "Un-read" the current token and mark the current value as a null
// token.
current_--;
Value v;
Value v(0);
currentValue().swapPayload(v);
currentValue().setOffsetStart(current_ - begin_ - 1);
currentValue().setOffsetLimit(current_ - begin_);
Expand Down Expand Up @@ -1357,7 +1357,7 @@ bool OurReader::readValue() {
break;
case tokenNull:
{
Value v;
Value v(0);
currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
Expand Down Expand Up @@ -1394,7 +1394,7 @@ bool OurReader::readValue() {
// "Un-read" the current token and mark the current value as a null
// token.
current_--;
Value v;
Value v(0);
currentValue().swapPayload(v);
currentValue().setOffsetStart(current_ - begin_ - 1);
currentValue().setOffsetLimit(current_ - begin_);
Expand Down Expand Up @@ -2958,6 +2958,7 @@ Value::Value(Value const& other)
// Move constructor
Value::Value(Value&& other) {
initBasic(nullValue);
value_.int_ = 0;
swap(other);
}
#endif
Expand Down