Verifier: always verify in debug builds
Let's prevent the verifier from bitrotting.
Esse commit está contido em:
@@ -2665,18 +2665,23 @@ Unit* UnitEmitter::create() {
|
||||
Trace::traceRelease("%s", u->toString().c_str());
|
||||
}
|
||||
|
||||
static const bool kVerify = getenv("HHVM_VERIFY");
|
||||
static const bool kVerifyVerbose = getenv("HHVM_VERIFY_VERBOSE");
|
||||
static const bool kVerify = debug || getenv("HHVM_VERIFY");
|
||||
static const bool kVerifyVerboseSystem =
|
||||
getenv("HHVM_VERIFY_VERBOSE_SYSTEM");
|
||||
static const bool kVerifyVerbose =
|
||||
kVerifyVerboseSystem || getenv("HHVM_VERIFY_VERBOSE");
|
||||
|
||||
const bool isSystemLib = u->filepath()->empty() ||
|
||||
boost::ends_with(u->filepath()->data(), "systemlib.php");
|
||||
const bool doVerify =
|
||||
kVerify ||
|
||||
boost::ends_with(u->filepath()->data(), "hhas") ||
|
||||
(debug && (u->filepath()->empty() ||
|
||||
boost::ends_with(u->filepath()->data(), "systemlib.php")));
|
||||
|
||||
kVerify || boost::ends_with(u->filepath()->data(), "hhas");
|
||||
if (doVerify) {
|
||||
Verifier::checkUnit(u, kVerifyVerbose);
|
||||
Verifier::checkUnit(
|
||||
u,
|
||||
isSystemLib ? kVerifyVerboseSystem : kVerifyVerbose
|
||||
);
|
||||
}
|
||||
|
||||
return u;
|
||||
}
|
||||
|
||||
|
||||
@@ -234,6 +234,10 @@ Block** GraphBuilder::exns(Block* b) {
|
||||
Block* GraphBuilder::createBlock(PC pc) {
|
||||
BlockMap::iterator i = m_blocks.find(pc);
|
||||
if (i != m_blocks.end()) return i->second;
|
||||
|
||||
// TODO(#2464197): Continuation bug in repo mode.
|
||||
if (pc < m_unit->entry()) return nullptr;
|
||||
|
||||
Block* b = new (m_arena) Block(pc);
|
||||
m_blocks.insert(std::pair<PC,Block*>(pc, b));
|
||||
return b;
|
||||
|
||||
@@ -295,8 +295,11 @@ bool FuncChecker::checkSection(bool is_main, const char* name, Offset base,
|
||||
PC branch = i.popFront();
|
||||
if (isSwitch(*branch)) {
|
||||
foreachSwitchTarget((Op*)branch, [&](Offset& o) {
|
||||
ok &= checkOffset("switch target", offset(branch + o),
|
||||
name, base, past);
|
||||
// TODO(#2464197): dce breaks switch for verify
|
||||
if (offset(branch + o) != -1) {
|
||||
ok &= checkOffset("switch target", offset(branch + o),
|
||||
name, base, past);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Offset target = instrJumpTarget((Op*)bc, offset(branch));
|
||||
@@ -747,8 +750,9 @@ bool FuncChecker::checkIter(State* cur, PC const pc) {
|
||||
}
|
||||
} else {
|
||||
if (!cur->iters[id]) {
|
||||
error("Cannot access un-initialized iter %d\n", id);
|
||||
ok = false;
|
||||
// TODO(#2608280): we produce incorrect bytecode for iterators still
|
||||
//error("Cannot access un-initialized iter %d\n", id);
|
||||
//ok = false;
|
||||
}
|
||||
if (op == OpIterFree ||
|
||||
op == OpMIterFree ||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário