summaryrefslogtreecommitdiff
path: root/upb/symtab.c
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2014-12-03 14:18:28 -0800
committerJosh Haberman <jhaberman@gmail.com>2014-12-03 14:19:59 -0800
commit39c9a8bd5a278873e8ca00b0f50e2494a60deb26 (patch)
tree336ed01c8b25407151861a21efb53bc6ea83fb53 /upb/symtab.c
parent177212c82f62e86e67bca69d1dbcf9d39d9123c4 (diff)
Sync from Google-internal development.
Most notably, a JSON parser is now provided.
Diffstat (limited to 'upb/symtab.c')
-rw-r--r--upb/symtab.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/upb/symtab.c b/upb/symtab.c
index 0269618..2f2b444 100644
--- a/upb/symtab.c
+++ b/upb/symtab.c
@@ -298,8 +298,13 @@ bool upb_symtab_add(upb_symtab *s, upb_def *const*defs, int n, void *ref_donor,
upb_fielddef *f = upb_msg_iter_field(&j);
const char *name = upb_fielddef_subdefname(f);
if (name && !upb_fielddef_subdef(f)) {
+ // Try the lookup in the current set of to-be-added defs first. If not
+ // there, try existing defs.
upb_def *subdef = upb_resolvename(&addtab, base, name);
if (subdef == NULL) {
+ subdef = upb_resolvename(&s->symtab, base, name);
+ }
+ if (subdef == NULL) {
upb_status_seterrf(
status, "couldn't resolve name '%s' in message '%s'", name, base);
goto err;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback