summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNils Berg <berg.nils@gmail.com>2019-04-15 20:38:44 +0200
committerWouter van Oortmerssen <aardappel@gmail.com>2019-04-15 11:38:44 -0700
commit90441c207838f611e4459595d3ac57468bcde13a (patch)
tree930de81e370ab52bca08cb5eb9d52d0cbd2e344f /src
parentcef8f928bb64c05d12e7a9f67ed1246d43559f33 (diff)
downloadflatbuffers-90441c207838f611e4459595d3ac57468bcde13a.tar.gz
flatbuffers-90441c207838f611e4459595d3ac57468bcde13a.tar.bz2
flatbuffers-90441c207838f611e4459595d3ac57468bcde13a.zip
fix check for Enum defaults (#5292)
fixes #5288
Diffstat (limited to 'src')
-rw-r--r--src/idl_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp
index ba28ae6f..e26aa550 100644
--- a/src/idl_parser.cpp
+++ b/src/idl_parser.cpp
@@ -670,11 +670,11 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
if (token_ == '=') {
NEXT();
+ ECHECK(ParseSingleValue(&field->name, field->value, true));
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, true));
}
if (type.enum_def &&
!type.enum_def->is_union &&