Kills some live mutants on interpreter.cpp that affect consensus found with https://github.com/ViniciusCestarii/mutant-harness. They are:
<details> <summary>interpreter.cpp (killed by 4e7de2ac4cc6c08ff27620de01ccd9d66c568459): <code>OP_IF</code>/<code>OP_NOTIF</code> tapscript minimal-IF: <code>vch[0] != 1</code> -> <code>vch[0] > 1</code> </summary>
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 98b16ec..f9b08fe 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -624,7 +624,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
if (sigversion == SigVersion::TAPSCRIPT) {
// The input argument to the OP_IF and OP_NOTIF opcodes must be either
// exactly 0 (the empty vector) or exactly 1 (the one-byte vector with value 1).
- if (vch.size() > 1 || (vch.size() == 1 && vch[0] != 1)) {
+ if (vch.size() > 1 || (vch.size() == 1 && vch[0] > 1)) {
return set_error(serror, SCRIPT_ERR_TAPSCRIPT_MINIMALIF);
}
}
</details>
<details> <summary>interpreter.cpp (killed by f1380123b6f8912e2ca599f30f2d89c0af9b9c5f): P2WSH: <code>memcmp(hash_exec_script.begin(), program.data(), 32)</code> -> <code>31</code></summary>
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 98b16ec..73a1bb5 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -1940,7 +1940,7 @@ static bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion,
exec_script = CScript(script_bytes.begin(), script_bytes.end());
uint256 hash_exec_script;
CSHA256().Write(exec_script.data(), exec_script.size()).Finalize(hash_exec_script.begin());
- if (memcmp(hash_exec_script.begin(), program.data(), 32)) {
+ if (memcmp(hash_exec_script.begin(), program.data(), 31)) {
return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH);
}
return ExecuteWitnessScript(stack, exec_script, flags, SigVersion::WITNESS_V0, checker, execdata, serror);
</details>
<details> <summary>interpreter.cpp (killed by 44a7083d43604b3d5c923ffc9011d8043a27d052): opcode limit: <code>sigversion == BASE || sigversion == WITNESS_V0</code> -> <code>sigversion == BASE</code></summary>
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 98b16ec..b117045 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -457,7 +457,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE)
return set_error(serror, SCRIPT_ERR_PUSH_SIZE);
- if (sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0) {
+ if (sigversion == SigVersion::BASE) {
// Note how OP_RESERVED does not count towards the opcode limit.
if (opcode > OP_16 && ++nOpCount > MAX_OPS_PER_SCRIPT) {
return set_error(serror, SCRIPT_ERR_OP_COUNT);
</details>
Recommend reviewing per commit.