From 17f2ae8df751e9d7dadc8c33af5a60878a5e944b Mon Sep 17 00:00:00 2001 From: mwilliams Date: Sun, 31 Mar 2013 11:07:12 -0700 Subject: [PATCH] Fix the context class for continuations in closures The late static bound class was being used for the context. This was wrong, but before this change there was no context at all, so it would have taken newly written code to expose the bug. However, a given continuation can be instantiated from a large number of different lsb classes (but only one context class) which meant that we got an explosion of unnecessary translations. --- hphp/runtime/vm/bytecode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hphp/runtime/vm/bytecode.cpp b/hphp/runtime/vm/bytecode.cpp index 7c85672cf..41130b191 100644 --- a/hphp/runtime/vm/bytecode.cpp +++ b/hphp/runtime/vm/bytecode.cpp @@ -6702,7 +6702,7 @@ VMExecutionContext::createContinuation(ActRec* fp, Class* cls = frameStaticClass(fp); if (origFunc->isClosureBody()) { - genFunc = genFunc->cloneAndSetClass(cls); + genFunc = genFunc->cloneAndSetClass(fp->m_func->cls()); } if (obj.get()) {