From 4e7457bd8c04b7580fd77dc11cc297c3cde26da9 Mon Sep 17 00:00:00 2001 From: mwilliams Date: Mon, 1 Apr 2013 16:58:13 -0700 Subject: [PATCH] Fix FPushClsMethodD in hhir Non-persistent classes can't be burnt in (or at least, you have to check the target cache before using it). --- hphp/runtime/vm/translator/hopt/hhbctranslator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp b/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp index 5f2039aa9..980dccf4c 100644 --- a/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp +++ b/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp @@ -1353,7 +1353,11 @@ void HhbcTranslator::emitFPushClsMethodD(int32_t numParams, SSATmp* objOrCls; if (!mightNotBeStatic) { // definitely static // static function: store base class into the m_cls/m_this slot - objOrCls = m_tb->genDefConst(baseClass); + if (TargetCache::isPersistentHandle(baseClass->m_cachedOffset)) { + objOrCls = m_tb->genDefConst(baseClass); + } else { + objOrCls = m_tb->gen(LdClsCached, m_tb->genDefConst(className)); + } } else if (m_tb->isThisAvailable()) { // 'this' pointer is available, so use it. assert(getCurClass());