mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix ForInOfStatementNode labeled continue handling (Issues #1571 Crashes #3-4)
Issue #1571 Crash #3: Labeled continue in for-of loop - Iterator value issue when labeled continue triggered early - Proper sequencing of iterator cleanup vs control flow Issue #1571 Crash #4: With statement + labeled for-of - Environment unwinding coordination with iterator cleanup - CloseLexicalEnvironment called at correct time Solution: Consume labeled continues with proper morphing - Ensures iterator cleanup finalizer runs before unwinding - Control flow record management stays consistent - Both for-in and for-of (and for-await-of) properly handled 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
beee65baec
commit
f480402fac
1 changed files with 6 additions and 0 deletions
|
|
@ -373,6 +373,12 @@ public:
|
|||
newContext.consumeContinuePositions(codeBlock, continuePosition, newContext.tryCatchWithBlockStatementCount());
|
||||
newContext.m_positionToContinue = continuePosition;
|
||||
|
||||
// Consume labeled continues targeting THIS loop with proper morphing (Issue #1571)
|
||||
// This ensures iterator cleanup and environment unwinding are properly sequenced
|
||||
if (context->m_currentLoopLabel) {
|
||||
newContext.consumeLabelledContinuePositions(codeBlock, continuePosition, context->m_currentLoopLabel, newContext.tryCatchWithBlockStatementCount());
|
||||
}
|
||||
|
||||
if (!m_forIn) {
|
||||
TryStatementNode::generateTryStatementBodyEndByteCode(codeBlock, &newContext, this, forOfTryStatementContext);
|
||||
TryStatementNode::generateTryFinalizerStatementStartByteCode(codeBlock, &newContext, this, forOfTryStatementContext, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue