Merge pull request #376 from kacprzak/master

Read from moved object
This commit is contained in:
Syoyo Fujita 2022-09-03 01:16:41 +09:00 committed by GitHub
commit 24e539621d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3229,9 +3229,11 @@ static bool ParseJsonAsValue(Value *ret, const json &o) {
break; break;
} }
#endif #endif
const bool isNotNull = val.Type() != NULL_TYPE;
if (ret) *ret = std::move(val); if (ret) *ret = std::move(val);
return val.Type() != NULL_TYPE; return isNotNull;
} }
static bool ParseExtrasProperty(Value *ret, const json &o) { static bool ParseExtrasProperty(Value *ret, const json &o) {
@ -3671,7 +3673,8 @@ static bool ParseParameterProperty(Parameter *param, std::string *err,
// Found a number array. // Found a number array.
return true; return true;
} else if (ParseNumberProperty(&param->number_value, err, o, prop, false)) { } else if (ParseNumberProperty(&param->number_value, err, o, prop, false)) {
return param->has_number_value = true; param->has_number_value = true;
return true;
} else if (ParseJSONProperty(&param->json_double_value, err, o, prop, } else if (ParseJSONProperty(&param->json_double_value, err, o, prop,
false)) { false)) {
return true; return true;