mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix ForStatementNode labeled continue handling (Issues #1571 Crashes #3-13)
Issue #1571 Crashes #3-4: Labeled continue in for loops - Consume labeled continues targeting this loop with proper morphing - Ensures iterator cleanup and environment unwinding work correctly Issue #1571 Crashes #5-13: Environment record mismatch in labeled loops - Proper morphing of labeled continues across allocated block boundaries - Fixes crashes from scope-creating constructs in labeled loops - Plain Jump path preserved for non-allocated blocks (zero overhead) Solution: Call consumeLabelledContinuePositions with morphing enabled - If no allocated block: plain Jump (fast path) - If allocated block: JumpComplexCase with proper unwinding (correct path) - Morphing is automatic via morphJumpPositionIntoComplexCase Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
9216bd2a4f
commit
beee65baec
1 changed files with 6 additions and 0 deletions
|
|
@ -206,6 +206,12 @@ public:
|
|||
newContext.consumeContinuePositions(codeBlock, updatePosition, newContext.tryCatchWithBlockStatementCount());
|
||||
newContext.m_positionToContinue = updatePosition;
|
||||
|
||||
// Consume labeled continues targeting THIS loop with proper morphing (Issue #1571)
|
||||
// This ensures continues inside allocated blocks are properly unwound via JumpComplexCase
|
||||
if (context->m_currentLoopLabel) {
|
||||
newContext.consumeLabelledContinuePositions(codeBlock, updatePosition, context->m_currentLoopLabel, newContext.tryCatchWithBlockStatementCount());
|
||||
}
|
||||
|
||||
if (m_iterationLexicalBlockIndex != LEXICAL_BLOCK_INDEX_MAX) {
|
||||
InterpretedCodeBlock::BlockInfo* bi = codeBlock->m_codeBlock->blockInfo(m_iterationLexicalBlockIndex);
|
||||
codeBlock->finalizeLexicalBlock(&newContext, iterationBlockContext);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue