From 4e547faa8f8cd5d635de28174d40f428456181cb Mon Sep 17 00:00:00 2001 From: Jordan DeLong Date: Mon, 3 Jun 2013 20:48:49 -0700 Subject: [PATCH] Verifier: disable iterator checks, turn verifier on for systemlib @override-unit-failures It's better to have some checks than none. The only checks failing in systemlib are iterator lifetime things, which it seems like we're not about to fix. Run the verifier on systemlib but only in debug builds. --- hphp/runtime/vm/unit.cpp | 14 ++++++++------ hphp/runtime/vm/verifier/check_func.cpp | 18 +++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hphp/runtime/vm/unit.cpp b/hphp/runtime/vm/unit.cpp index a9f730c52..38e69e805 100644 --- a/hphp/runtime/vm/unit.cpp +++ b/hphp/runtime/vm/unit.cpp @@ -2649,13 +2649,15 @@ Unit* UnitEmitter::create() { Trace::traceRelease(u->toString()); } - static const bool kAlwaysVerify = getenv("HHVM_ALWAYS_VERIFY"); - static const bool kVerifyNonSystem = getenv("HHVM_VERIFY"); + static const bool kVerify = getenv("HHVM_VERIFY"); static const bool kVerifyVerbose = getenv("HHVM_VERIFY_VERBOSE"); - const bool doVerify = kAlwaysVerify || - (kVerifyNonSystem && !u->filepath()->empty() && - !boost::ends_with(u->filepath()->data(), "systemlib.php")) || - boost::ends_with(u->filepath()->data(), "hhas"); + + const bool doVerify = + kVerify || + boost::ends_with(u->filepath()->data(), "hhas") || + (debug && (u->filepath()->empty() || + boost::ends_with(u->filepath()->data(), "systemlib.php"))); + if (doVerify) { Verifier::checkUnit(u, kVerifyVerbose); } diff --git a/hphp/runtime/vm/verifier/check_func.cpp b/hphp/runtime/vm/verifier/check_func.cpp index 08ff2cd86..3616e17ea 100644 --- a/hphp/runtime/vm/verifier/check_func.cpp +++ b/hphp/runtime/vm/verifier/check_func.cpp @@ -903,7 +903,9 @@ bool FuncChecker::checkFlow() { ok &= checkInputs(&cur, pc, b); if (isTF(pc)) ok &= checkTerminal(&cur, pc); if (isFF(pc)) ok &= checkFpi(&cur, pc, b); - if (isIter(pc)) ok &= checkIter(&cur, pc); + // TODO(#1097182) Iterator checking is disabled, because + // systemlib currently doesn't pass it. + /* if (isIter(pc)) ok &= checkIter(&cur, pc); */ ok &= checkOutputs(&cur, pc, b); } ok &= checkSuccEdges(b, &cur); @@ -1023,12 +1025,14 @@ bool FuncChecker::checkEdge(Block* b, const State& cur, Block *t) { } } // Check iterator variable state. - for (int i = 0, n = numIters(); i < n; i++) { - if (state.iters[i] != cur.iters[i]) { - verify_error("mismatched iterator state on edge B%d->B%d, " - "current %s target %s\n", b->id, t->id, - iterToString(cur).c_str(), iterToString(state).c_str()); - return false; + if (false /* TODO(#1097182): Iterator verification disabled */) { + for (int i = 0, n = numIters(); i < n; i++) { + if (state.iters[i] != cur.iters[i]) { + verify_error("mismatched iterator state on edge B%d->B%d, " + "current %s target %s\n", b->id, t->id, + iterToString(cur).c_str(), iterToString(state).c_str()); + return false; + } } } return ok;