diff --git a/hphp/runtime/vm/jit/codegen.cpp b/hphp/runtime/vm/jit/codegen.cpp index 56c309370..625e6d812 100644 --- a/hphp/runtime/vm/jit/codegen.cpp +++ b/hphp/runtime/vm/jit/codegen.cpp @@ -840,12 +840,17 @@ void CodeGenerator::cgBeginCatch(IRInstruction* inst) { PhysRegSaverParity::emitPops(m_as, info.savedRegs); } +static void unwindResumeHelper(_Unwind_Exception* data) { + tl_regState = VMRegState::CLEAN; + _Unwind_Resume(data); +} + void CodeGenerator::cgEndCatch(IRInstruction* inst) { m_as.cmpb (0, rVmTl[TargetCache::kUnwinderSideExitOff]); unlikelyIfBlock(CC_E, [&](Asm& as) { // doSideExit == false, so call _Unwind_Resume as.loadq(rVmTl[TargetCache::kUnwinderScratchOff], rdi); - as.call ((TCA)_Unwind_Resume); // pass control back to the unwinder + as.call ((TCA)unwindResumeHelper); // pass control back to the unwinder as.ud2(); }); diff --git a/hphp/runtime/vm/jit/unwind-x64.cpp b/hphp/runtime/vm/jit/unwind-x64.cpp index f2785c483..afb3af6cd 100644 --- a/hphp/runtime/vm/jit/unwind-x64.cpp +++ b/hphp/runtime/vm/jit/unwind-x64.cpp @@ -99,6 +99,7 @@ bool install_catch_trace(_Unwind_Context* ctx, _Unwind_Exception* exn, TargetCache::header()->unwinderTv = ism->tv(); } _Unwind_SetIP(ctx, (uint64_t)catchTrace); + tl_regState = VMRegState::DIRTY; return true; } diff --git a/hphp/test/quick/bad_setm.php b/hphp/test/quick/bad_setm.php new file mode 100644 index 000000000..e3238e925 --- /dev/null +++ b/hphp/test/quick/bad_setm.php @@ -0,0 +1,19 @@ +