summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jsmn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/jsmn.c b/jsmn.c
index da9bf217c..bcd6392a0 100644
--- a/jsmn.c
+++ b/jsmn.c
@@ -198,7 +198,7 @@ int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
break;
}
if (token->parent == -1) {
- if(token->type != type) {
+ if(token->type != type || parser->toksuper == -1) {
return JSMN_ERROR_INVAL;
}
break;