From ea8506648913eaa5a5734db87dacbc8466f4cc83 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Mon, 29 Aug 2016 15:55:12 -0700 Subject: JSON: fix a couple cases of the wrong closure being passed to end handlers. --- upb/json/parser.rl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'upb') diff --git a/upb/json/parser.rl b/upb/json/parser.rl index b0fcdba..15ca477 100644 --- a/upb/json/parser.rl +++ b/upb/json/parser.rl @@ -785,8 +785,8 @@ static bool end_stringval(upb_json_parser *p) { case UPB_TYPE_STRING: { upb_selector_t sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR); - upb_sink_endstr(&p->top->sink, sel); p->top--; + upb_sink_endstr(&p->top->sink, sel); break; } @@ -884,7 +884,7 @@ static bool parse_mapentry_key(upb_json_parser *p) { sel = getsel_for_handlertype(p, UPB_HANDLER_STRING); upb_sink_putstring(&subsink, sel, buf, len, NULL); sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR); - upb_sink_endstr(&subsink, sel); + upb_sink_endstr(&p->top->sink, sel); multipart_end(p); break; } -- cgit v1.2.3