← All issues

[25] [JSC] Don't advance bytecode when reifying inline frames at a checkpoint

Severity: Medium | Component: JSC DFG JIT | 4e802a1

Medium severity로 분류됩니다. diff는 잘못된 exception-handler dispatch metadata를 수정합니다. OSR exit 중 reified baseline frame에 기록되는 CallSiteIndex가 checkpoint 이후의 bytecode 위치를 가리키고 있어, re-executed checkpoint instruction에서 throw가 발생하면 잘못된 HandlerInfo try-range로 매핑됩니다.

reifyInlinedCallFramesbytecodeIndexForExit(...)를 사용했습니다. 이 함수는 checkpoint가 포함된 index를 checkpoint 이후의 bytecode 위치로 정규화합니다. 재개(resumption) 목적으로는 올바른 동작이지만, unwinding 시에는 잘못된 위치를 참조하게 됩니다.

Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp

- BytecodeIndex exitIndex = baselineCodeBlock->bytecodeIndexForExit(codeOrigin->bytecodeIndex());
+ BytecodeIndex exitIndex(codeOrigin->bytecodeIndex().offset());

Checkpoint에서 inline frame을 reify할 때, resumption에 사용되는 bytecode index와 exception-handler 조회에 사용되는 bytecode index 간의 off-by-one.

🔒

How an off-by-one in a JIT bookkeeping helper rewrites the JavaScript exception-handling contract, and how far that semantic divergence might be pushed.

더 확인하려면 구독해 주세요

🔒

Three reusable patterns for finding similar checkpoint/index-normalization mismatches across JSC's OSR exit, unwind, and inline-cache paths.

더 확인하려면 구독해 주세요