diff --git a/hphp/runtime/vm/jit/codegen.cpp b/hphp/runtime/vm/jit/codegen.cpp index 96c053456..93db583c0 100644 --- a/hphp/runtime/vm/jit/codegen.cpp +++ b/hphp/runtime/vm/jit/codegen.cpp @@ -2557,7 +2557,7 @@ void CodeGenerator::cgSpill(IRInstruction* inst) { m_as.movdqa(srcReg, reg::rsp[sinfo.offset()]); } else { int offset = sinfo.offset(); - if (locIndex == 0 || packed_tv) { + if (locIndex == 0 || packed_tv || src->type().subtypeOf(Type::FuncCtx)) { emitStoreReg(m_as, srcReg, reg::rsp[offset]); } else { // Note that type field is shifted in memory @@ -2583,7 +2583,7 @@ void CodeGenerator::cgReload(IRInstruction* inst) { m_as.movdqa(reg::rsp[sinfo.offset()], dstReg); } else { int offset = sinfo.offset(); - if (locIndex == 0 || packed_tv) { + if (locIndex == 0 || packed_tv || src->type().subtypeOf(Type::FuncCtx)) { emitLoadReg(m_as, reg::rsp[offset], dstReg); } else { // Note that type field is shifted in memory