From 79b63842a2e1ea4f93e4d7fa4a1a3198a849ef4b Mon Sep 17 00:00:00 2001 From: bsimmers Date: Thu, 12 Jun 2014 17:22:13 -0700 Subject: [PATCH] LookupCnsE needs a catch block Reviewed By: @alexmalyshev Differential Revision: D1381275 --- hphp/runtime/vm/jit/hhbc-translator.cpp | 2 +- hphp/test/slow/constant/stdin.php | 7 +++++++ hphp/test/slow/constant/stdin.php.expect | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 hphp/test/slow/constant/stdin.php create mode 100644 hphp/test/slow/constant/stdin.php.expect diff --git a/hphp/runtime/vm/jit/hhbc-translator.cpp b/hphp/runtime/vm/jit/hhbc-translator.cpp index 990f3ebd699..70d70e70a44 100644 --- a/hphp/runtime/vm/jit/hhbc-translator.cpp +++ b/hphp/runtime/vm/jit/hhbc-translator.cpp @@ -694,7 +694,7 @@ void HhbcTranslator::emitCnsCommon(uint32_t id, // lookup. assert(!fallbackNameTmp); if (error) { - result = gen(LookupCnsE, cnsNameTmp); + result = gen(LookupCnsE, makeCatch(), cnsNameTmp); } else { result = gen(LookupCns, makeCatch(), cnsNameTmp); } diff --git a/hphp/test/slow/constant/stdin.php b/hphp/test/slow/constant/stdin.php new file mode 100644 index 00000000000..518969c2e3f --- /dev/null +++ b/hphp/test/slow/constant/stdin.php @@ -0,0 +1,7 @@ +