mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix WhileStatementNode labeled continue handling (Issue #1571)
Issue #1571: Labeled continue in while loops with allocated blocks - Proper morphing for labeled continues crossing block boundaries - Fixes environment record consistency in labeled loops - Applies fix pattern to all loop statement types 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
8fd141b29c
commit
7e2b3292fd
1 changed files with 6 additions and 0 deletions
|
|
@ -80,6 +80,12 @@ public:
|
|||
|
||||
codeBlock->pushCode(Jump(ByteCodeLOC(m_loc.index), whileStart), &newContext, this->m_loc.index);
|
||||
newContext.consumeContinuePositions(codeBlock, whileStart, newContext.tryCatchWithBlockStatementCount());
|
||||
|
||||
// Consume labeled continues targeting THIS loop with proper morphing (Issue #1571)
|
||||
if (context->m_currentLoopLabel) {
|
||||
newContext.consumeLabelledContinuePositions(codeBlock, whileStart, context->m_currentLoopLabel, newContext.tryCatchWithBlockStatementCount());
|
||||
}
|
||||
|
||||
size_t whileEnd = codeBlock->currentCodeSize();
|
||||
newContext.consumeBreakPositions(codeBlock, whileEnd, newContext.tryCatchWithBlockStatementCount());
|
||||
if (testPos != SIZE_MAX)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue