jerryscript-project / jerryscript

Ultra-lightweight JavaScript engine for the Internet of Things.
https://jerryscript.net
Apache License 2.0
6.88k stars 666 forks source link

Assertion 'info_type == SCANNER_TYPE_FUNCTION || info_type == SCANNER_TYPE_BLOCK' failed at jerryscript/jerry-core/parser/js/js-scanner-util.c(scanner_create_variables):2322. #5056

Open EJueon opened 1 year ago

EJueon commented 1 year ago
JerryScript revision

Commit: 1a2c0476 Version: v3.0.0

Build platform

Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)

Build steps
python ./tools/build.py --clean --debug --compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer --compile-flag=-fno-common --compile-flag=-fsanitize=address --compile-flag=-g --strip=off --lto=off --error-messages=on --system-allocator=on --logging=on --line-info=on --stack-limit=20
Test case
// poc1.js
class foo {static {}; static {};}; 
Execution steps & Output
$ ./jerryscript/build/bin/jerry poc1.js
ICE: Assertion 'info_type == SCANNER_TYPE_FUNCTION || info_type == SCANNER_TYPE_BLOCK' failed at jerryscript/jerry-core/parser/js/js-scanner-util.c(scanner_create_variables):2322.
Error: JERRY_FATAL_FAILED_ASSERTION
Aborted

Test case+
// poc2.js
class foo { static {}; }; 
Execution steps & Output+
$ ./jerryscript/build/bin/jerry poc2.js
ICE: Assertion 'context.status_flags & PARSER_SCANNING_SUCCESSFUL' failed at jerryscript/jerry-core/parser/js/js-parser.c(parser_parse_source):2288.
Error: JERRY_FATAL_FAILED_ASSERTION
Aborted

Credits: @EJueon, @Ye0nny of the seclab-yonsei.