diff --git a/hphp/runtime/vm/translator/hopt/vectortranslator.cpp b/hphp/runtime/vm/translator/hopt/vectortranslator.cpp index 46459870b..cf4a3236d 100644 --- a/hphp/runtime/vm/translator/hopt/vectortranslator.cpp +++ b/hphp/runtime/vm/translator/hopt/vectortranslator.cpp @@ -600,8 +600,7 @@ static inline TypedValue* baseGImpl(TypedValue *key, varEnv->set(name, &tv); base = varEnv->lookup(name); } else { - tvWriteNull(&mis->tvScratch); - base = &mis->tvScratch; + return const_cast(init_null_variant.asTypedValue()); } } decRefStr(name); diff --git a/hphp/test/vm/unset_undef_g.php b/hphp/test/vm/unset_undef_g.php new file mode 100644 index 000000000..3a1e6c52d --- /dev/null +++ b/hphp/test/vm/unset_undef_g.php @@ -0,0 +1,5 @@ +