[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 35/56] json: Don't create JSON_ERROR tokens that won
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH 35/56] json: Don't create JSON_ERROR tokens that won't be used |
Date: |
Wed, 8 Aug 2018 14:03:13 +0200 |
Signed-off-by: Markus Armbruster <address@hidden>
---
qobject/json-streamer.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c
index 0c33186e8e..fa595a8761 100644
--- a/qobject/json-streamer.c
+++ b/qobject/json-streamer.c
@@ -56,6 +56,8 @@ void json_message_process_token(JSONLexer *lexer, GString
*input,
case JSON_RSQUARE:
parser->bracket_count--;
break;
+ case JSON_ERROR:
+ goto out_emit;
default:
break;
}
@@ -71,10 +73,6 @@ void json_message_process_token(JSONLexer *lexer, GString
*input,
g_queue_push_tail(parser->tokens, token);
- if (type == JSON_ERROR) {
- goto out_emit;
- }
-
if (parser->brace_count < 0 ||
parser->bracket_count < 0 ||
(parser->brace_count == 0 &&
--
2.17.1
- Re: [Qemu-devel] [PATCH 03/56] check-qjson: Cover whitespace more thoroughly, (continued)
- [Qemu-devel] [PATCH 07/56] check-qjson: Cover escaped characters more thoroughly, part 1, Markus Armbruster, 2018/08/08
- [Qemu-devel] [PATCH 08/56] check-qjson: Streamline escaped_string()'s test strings, Markus Armbruster, 2018/08/08
- [Qemu-devel] [PATCH 35/56] json: Don't create JSON_ERROR tokens that won't be used,
Markus Armbruster <=
- [Qemu-devel] [PATCH 17/56] json: Reject unescaped control characters, Markus Armbruster, 2018/08/08
- [Qemu-devel] [PATCH 23/56] json: Leave rejecting invalid UTF-8 to parser, Markus Armbruster, 2018/08/08
- [Qemu-devel] [PATCH 18/56] json: Revamp lexer documentation, Markus Armbruster, 2018/08/08