projects
/
platform
/
upstream
/
flatbuffers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cfb4ecf
)
Fix namespaced struct/field name collision detection (#5540) (#5545)
author
Jack Zhou
<hkmix@users.noreply.github.com>
Mon, 30 Sep 2019 18:50:03 +0000
(14:50 -0400)
committer
Wouter van Oortmerssen
<aardappel@gmail.com>
Mon, 30 Sep 2019 18:50:03 +0000
(11:50 -0700)
Changes the use of `LookupStruct` to `LookupCreateStruct` in
`ParseField` to also detect when collisions happen in namespaces.
src/idl_parser.cpp
patch
|
blob
|
history
diff --git
a/src/idl_parser.cpp
b/src/idl_parser.cpp
index
50d59a2
..
bc3d063
100644
(file)
--- a/
src/idl_parser.cpp
+++ b/
src/idl_parser.cpp
@@
-677,7
+677,7
@@
CheckedError Parser::AddField(StructDef &struct_def, const std::string &name,
CheckedError Parser::ParseField(StructDef &struct_def) {
std::string name = attribute_;
- if (Lookup
Struct(nam
e))
+ if (Lookup
CreateStruct(name, false, fals
e))
return Error("field name can not be the same as table/struct name");
std::vector<std::string> dc = doc_comment_;