mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
Fixed flatc silently accepting non-scalars as default values.
Bug: 17304016 Change-Id: I4873f8ef32fbb2657f15fc53a2c8f767e10f2d96 Tested: on Linux
This commit is contained in:
@@ -364,6 +364,8 @@ void Parser::ParseField(StructDef &struct_def) {
|
||||
|
||||
if (token_ == '=') {
|
||||
Next();
|
||||
if (!IsScalar(type.base_type))
|
||||
Error("default values currently only supported for scalars");
|
||||
ParseSingleValue(field.value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user