Fixed assert in ParseSingleValue (found by fuzzer)
Change-Id: I84674eaab75b2b455e918b04e3027920430678ac
This commit is contained in:
parent
8f1bebba05
commit
7c3cb5caa1
|
@ -669,11 +669,11 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
|
|||
|
||||
if (token_ == '=') {
|
||||
NEXT();
|
||||
ECHECK(ParseSingleValue(&field->name, field->value));
|
||||
if (!IsScalar(type.base_type) ||
|
||||
(struct_def.fixed && field->value.constant != "0"))
|
||||
return Error(
|
||||
"default values currently only supported for scalars in tables");
|
||||
ECHECK(ParseSingleValue(&field->name, field->value));
|
||||
}
|
||||
if (type.enum_def &&
|
||||
!type.enum_def->is_union &&
|
||||
|
|
Loading…
Reference in New Issue