diff --git a/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp b/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp index 8e0b42692..74ced794b 100644 --- a/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp +++ b/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp @@ -2797,7 +2797,7 @@ template void HhbcTranslator::emitBind(const StringData* name, CheckSupportedFun checkSupported, EmitLdAddrFun emitLdAddr) { - if (!(this->*checkSupported)(name, topC(0)->type(), 1)) return; + if (!(this->*checkSupported)(name, topV(0)->type(), 1)) return; SSATmp* src = popV(); emitBindMem((this->*emitLdAddr)(name), src); } diff --git a/hphp/runtime/vm/translator/hopt/hhbctranslator.h b/hphp/runtime/vm/translator/hopt/hhbctranslator.h index 88f0b591a..7c4478ef7 100644 --- a/hphp/runtime/vm/translator/hopt/hhbctranslator.h +++ b/hphp/runtime/vm/translator/hopt/hhbctranslator.h @@ -657,6 +657,7 @@ private: SSATmp* popA() { return pop(Type::Cls); } SSATmp* popF() { return pop(Type::Gen); } SSATmp* topC(uint32_t i = 0) { return top(Type::Cell, i); } + SSATmp* topV(uint32_t i = 0) { return top(Type::BoxedCell, i); } std::vector peekSpillValues() const; SSATmp* emitSpillStack(Trace* t, SSATmp* sp, const std::vector& spillVals); diff --git a/hphp/test/quick/BindS_twice.php b/hphp/test/quick/BindS_twice.php new file mode 100644 index 000000000..275d89310 --- /dev/null +++ b/hphp/test/quick/BindS_twice.php @@ -0,0 +1,19 @@ +