From a601685e34c61658f85d836a94f785192a5b426b Mon Sep 17 00:00:00 2001 From: ᴀᴇꜱᴏᴘʜᴏʀ Date: Sat, 30 Oct 2021 21:56:42 +0800 Subject: Core/Executor: use `nullptr` instead of `0` Since KLEE requires C++14, we should prefer `nullptr` to plain `0`. --- lib/Core/Executor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/Core') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 74ca7fb7..dcb078df 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -1048,7 +1048,7 @@ Executor::fork(ExecutionState ¤t, ref condition, bool isInternal) { if (!success) { current.pc = current.prevPC; terminateStateEarly(current, "Query timed out (fork)."); - return StatePair(0, 0); + return StatePair(nullptr, nullptr); } if (!isSeeding) { @@ -1133,7 +1133,7 @@ Executor::fork(ExecutionState ¤t, ref condition, bool isInternal) { } } - return StatePair(¤t, 0); + return StatePair(¤t, nullptr); } else if (res==Solver::False) { if (!isInternal) { if (pathWriter) { @@ -1141,7 +1141,7 @@ Executor::fork(ExecutionState ¤t, ref condition, bool isInternal) { } } - return StatePair(0, ¤t); + return StatePair(nullptr, ¤t); } else { TimerStatIncrementer timer(stats::forkTime); ExecutionState *falseState, *trueState = ¤t; @@ -1212,7 +1212,7 @@ Executor::fork(ExecutionState ¤t, ref condition, bool isInternal) { if (MaxDepth && MaxDepth<=trueState->depth) { terminateStateEarly(*trueState, "max-depth exceeded."); terminateStateEarly(*falseState, "max-depth exceeded."); - return StatePair(0, 0); + return StatePair(nullptr, nullptr); } return StatePair(trueState, falseState); @@ -2110,7 +2110,7 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { case Instruction::Ret: { ReturnInst *ri = cast(i); KInstIterator kcaller = state.stack.back().caller; - Instruction *caller = kcaller ? kcaller->inst : 0; + Instruction *caller = kcaller ? kcaller->inst : nullptr; bool isVoidReturn = (ri->getNumOperands() == 0); ref result = ConstantExpr::alloc(0, Expr::Bool); -- cgit 1.4.1