Add missing m_currentLoopLabel field and fix Crashes #1-2

- Add m_currentLoopLabel to ByteCodeGenerateContext for tracking labeled loop labels (Issue #1571)
- Fix Crash #1: Add bounds checking in inline cache proto traverse with std::min clamping
- Fix Crash #2: Check hasBinding before initializeBinding to prevent assertion on unreachable code paths

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
Seonghyun Kim 2026-06-15 14:21:35 +09:00 committed by MuHong Byun
commit 0a2fcaaf5e
3 changed files with 17 additions and 5 deletions

View file

@ -64,6 +64,7 @@ ByteCodeGenerateContext::ByteCodeGenerateContext(InterpretedCodeBlock* codeBlock
, m_lexicalBlockIndex(0)
, m_classInfo()
, m_numeralLiteralData(numeralLiteralData) // should be NumeralLiteralVector
, m_currentLoopLabel(nullptr)
#if defined(ENABLE_TCO)
, m_returnRegister(SIZE_MAX)
#endif