Skip to content

Commit

Permalink
parser: disallow empty hex, octal, binary literals
Browse files Browse the repository at this point in the history
Refs: metarhia/jstp#175
PR-URL: metarhia/jstp#207
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
  • Loading branch information
belochub committed Jul 21, 2018
1 parent a655e97 commit b5f45d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jsrs_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ MaybeLocal<Value> ParseNumber(Isolate* isolate,
} else {
result = ParseIntegerNumber(isolate, number_start, end, size,
base, negate_result);
if (*size == 0) {
THROW_EXCEPTION(SyntaxError, "Empty number value");
return MaybeLocal<Value>();
}
}
*size += number_start - begin;
return result;
Expand Down

0 comments on commit b5f45d6

Please sign in to comment.