Changeset 86960 in webkit
- Timestamp:
- May 20, 2011 9:19:38 AM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r86957 r86960 1 2011-05-20 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Interpreter uses wrong bytecode offset for determining exception handler 6 https://bugs.webkit.org/show_bug.cgi?id=61191 7 8 The bytecode offset given for the returnPC from the JIT is 9 actually the offset for the start of the instruction triggering 10 the call, whereas in the interpreter it is the actual return 11 VPC. This means if the next instruction following a call was 12 in an exception region we would incorrectly redirect to its 13 handler. Long term we want to completely redo how exceptions 14 are handled anyway so the simplest and lowest risk fix here is 15 to simply subtract one from the return vPC so that we have an 16 offset in the triggering instruction. 17 18 It turns out this is caught by a couple of tests already. 19 20 * interpreter/Interpreter.cpp: 21 (JSC::Interpreter::unwindCallFrame): 22 1 23 2011-05-20 Xan Lopez <xlopez@igalia.com> 2 24 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r86300 r86960 579 579 580 580 codeBlock = callerFrame->codeBlock(); 581 582 // Because of how the JIT records call site->bytecode offset 583 // information the JIT reports the bytecodeOffset for the returnPC 584 // to be at the beginning of the opcode that has caused the call. 585 // In the interpreter we have an actual return address, which is 586 // the beginning of next instruction to execute. To get an offset 587 // inside the call instruction that triggered the exception we 588 // have to subtract 1. 581 589 #if ENABLE(JIT) && ENABLE(INTERPRETER) 582 590 if (callerFrame->globalData().canUseJIT()) 583 591 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnPC()); 584 592 else 585 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnVPC()) ;593 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnVPC()) - 1; 586 594 #elif ENABLE(JIT) 587 595 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnPC()); 588 596 #else 589 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnVPC()) ;597 bytecodeOffset = codeBlock->bytecodeOffset(callFrame->returnVPC()) - 1; 590 598 #endif 591 599
Note: See TracChangeset
for help on using the changeset viewer.