escargot icon indicating copy to clipboard operation
escargot copied to clipboard

RELEASE_ASSERT_NOT_REACHED at src/parser/ast/Node.h (315)

Open Ye0nny opened this issue 7 months ago • 0 comments

Escargot

  • OS: Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)
  • Revision : bd95de3c46e515a387ae1c3d0b214d9ddbd99e90

Build Steps

cmake -DESCARGOT_MODE=debug -DESCARGOT_OUTPUT=shell -GNinja

Describe the bug RELEASE_ASSERT_NOT_REACHED

Test case

testcase

throw " Test262 : This statement should not statement should be optimized out of evaluated. " ; 
( {... { a = 0, b : a }. b = 1 } ) ;
// poc.js
( {... { a = 0 }. b = 1 } ) ;

Execution steps & Output

$ ./escargot/escargot poc.js
RELEASE_ASSERT_NOT_REACHED at src/parser/ast/Node.h (315)
Aborted

Backtrace

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7a70859 in __GI_abort () at abort.c:79
#2  0x00005555557e7f32 in Escargot::Node::generateExpressionByteCode (this=0x555555d12ae8, codeBlock=0xc1f50, context=0x7fffffffdb20, dstRegister=6) at src/parser/ast/Node.h:315
#3  0x000055555580cbc0 in Escargot::ObjectExpressionNode::generateInitValueByteCode (this=0x555555d12b40, codeBlock=0xc1f50, context=0x7fffffffdb20, p=0x555555d12b08,
    dstRegister=5) at src/parser/ast/ObjectExpressionNode.h:51
#4  0x000055555580da2c in Escargot::ObjectExpressionNode::generateExpressionByteCode (this=0x555555d12b40, codeBlock=0xc1f50, context=0x7fffffffdb20, dstRegister=5)
    at src/parser/ast/ObjectExpressionNode.h:151
#5  0x00005555557f2d4e in Escargot::MemberExpressionNode::generateResolveAddressByteCode (this=0x555555d12b88, codeBlock=0xc1f50, context=0x7fffffffdb20)
    at src/parser/ast/MemberExpressionNode.h:243
#6  0x00005555557f837b in Escargot::AssignmentExpressionSimpleNode::generateExpressionByteCode (this=0x555555d12bc8, codeBlock=0xc1f50, context=0x7fffffffdb20, dstRegister=1)
    at src/parser/ast/AssignmentExpressionSimpleNode.h:66
#7  0x000055555580df22 in Escargot::ObjectExpressionNode::generateExpressionByteCode (this=0x555555d12c10, codeBlock=0xc1f50, context=0x7fffffffdb20, dstRegister=0)
    at src/parser/ast/ObjectExpressionNode.h:183
#8  0x00005555558051be in Escargot::ExpressionStatementNode::generateStatementByteCode (this=0x555555d12c40, codeBlock=0xc1f50, context=0x7fffffffdb20)
    at src/parser/ast/ExpressionStatementNode.h:53
#9  0x00005555557edef8 in Escargot::StatementContainer::generateStatementByteCode (this=0x555555d12ab0, codeBlock=0xc1f50, context=0x7fffffffdb20)
    at src/parser/ast/StatementNode.h:107
#10 0x000055555580e65d in Escargot::ProgramNode::generateStatementByteCode (this=0x555555d12c60, codeBlock=0xc1f50, context=0x7fffffffdb20) at src/parser/ast/ProgramNode.h:48
#11 0x000055555570525c in Escargot::ByteCodeGenerator::generateByteCode (context=0xa3af0, codeBlock=0xbde30, ast=0x555555d12c60, inWithFromRuntime=false, cacheByteCode=false)
    at src/interpreter/ByteCodeGenerator.cpp:272
#12 0x00005555557e5f8c in Escargot::ScriptParser::initializeScript (this=0x59f70, originSource=0x0, originLineOffset=0, source=0xabf70, srcName=0x7a390, parentCodeBlock=0x0,
    isModule=false, isEvalMode=false, isEvalCodeInFunction=false, inWithOperation=false, strictFromOutside=false, allowSuperCall=false, allowSuperProperty=false,
    allowNewTarget=false, needByteCodeGeneration=true) at src/parser/ScriptParser.cpp:455
#13 0x000055555563bec4 in Escargot::ScriptParser::initializeScript (this=0x59f70, source=0xabf70, srcName=0x7a390, isModule=false) at src/parser/ScriptParser.h:57
#14 0x000055555564333d in Escargot::ScriptParserRef::initializeScript (this=0x59f70, source=0xabf70, srcName=0x7a390, isModule=false) at src/api/EscargotPublic.cpp:4626
#15 0x00005555559a3d07 in evalScript (context=0xa3af0, source=0xabf70, srcName=0x7a390, shouldPrintScriptResult=false, isModule=false) at src/shell/Shell.cpp:751
#16 0x00005555559a52bd in main (argc=2, argv=0x7fffffffe348) at src/shell/Shell.cpp:1130

when executed in release mode

Output

RELEASE_ASSERT_NOT_REACHED at src/parser/ast/Node.h (315)
Aborted

Expected behavior

Syntax Error.
Unexpected token '='. 
Expected ':' following the property name 'a'.

( {... { a = 0 }. b = 1 } ) ;
           ^

Credits: @Ye0nny, @EJueon

Ye0nny avatar Jan 21 '24 09:01 Ye0nny