diff --git a/hphp/runtime/base/tv_comparisons.cpp b/hphp/runtime/base/tv_comparisons.cpp index 839822a3c..72b8123d0 100644 --- a/hphp/runtime/base/tv_comparisons.cpp +++ b/hphp/runtime/base/tv_comparisons.cpp @@ -391,14 +391,14 @@ bool tvSame(const TypedValue* tv1, const TypedValue* tv2) { assert(tvIsPlausible(tv1)); assert(tvIsPlausible(tv2)); + tv1 = tvToCell(tv1); + tv2 = tvToCell(tv2); + bool const null1 = IS_NULL_TYPE(tv1->m_type); bool const null2 = IS_NULL_TYPE(tv2->m_type); if (null1 && null2) return true; if (null1 || null2) return false; - tv1 = tvToCell(tv1); - tv2 = tvToCell(tv2); - switch (tv1->m_type) { case KindOfInt64: case KindOfBoolean: diff --git a/hphp/test/slow/comparisons/refnull.php b/hphp/test/slow/comparisons/refnull.php new file mode 100644 index 000000000..c3495491b --- /dev/null +++ b/hphp/test/slow/comparisons/refnull.php @@ -0,0 +1,5 @@ +