mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 20:51:09 +00:00
Fixed enum declaration values being parsed as int.
This caused values in the uint range to be made negative values. Change-Id: Ia4284747f48508b589c034ff3aae0d141e96eb3c Tested: on Linux.
This commit is contained in:
@@ -1082,7 +1082,7 @@ CheckedError Parser::ParseEnum(bool is_union, EnumDef **dest) {
|
|||||||
}
|
}
|
||||||
if (Is('=')) {
|
if (Is('=')) {
|
||||||
NEXT();
|
NEXT();
|
||||||
ev.value = atoi(attribute_.c_str());
|
ev.value = StringToInt(attribute_.c_str());
|
||||||
EXPECT(kTokenIntegerConstant);
|
EXPECT(kTokenIntegerConstant);
|
||||||
if (!opts.proto_mode && prevsize &&
|
if (!opts.proto_mode && prevsize &&
|
||||||
enum_def.vals.vec[prevsize - 1]->value >= ev.value)
|
enum_def.vals.vec[prevsize - 1]->value >= ev.value)
|
||||||
|
|||||||
Reference in New Issue
Block a user