aboutsummaryrefslogtreecommitdiff
path: root/src/script.cpp
diff options
context:
space:
mode:
authorGiel van Schijndel <me@mortis.eu>2011-06-24 20:47:26 +0200
committerGiel van Schijndel <me@mortis.eu>2011-07-13 05:10:15 +0200
commit225f222c9fba7a831e2e5f80ccbba34ed2bca532 (patch)
tree95b16cabc2ff94021417521ff94296090f35e7db /src/script.cpp
parentd7f1d200ab5d385c727261621c069dfbc6170e78 (diff)
downloadbitcoin-225f222c9fba7a831e2e5f80ccbba34ed2bca532.tar.xz
fix warning: X enumeration values not handled in switch [-Wswitch-enum]
Add default cases to opcode switches to assert that they should never occur. Signed-off-by: Giel van Schijndel <me@mortis.eu>
Diffstat (limited to 'src/script.cpp')
-rw-r--r--src/script.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script.cpp b/src/script.cpp
index aa7f1f5116..654aaa10e3 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -580,6 +580,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
case OP_ABS: if (bn < bnZero) bn = -bn; break;
case OP_NOT: bn = (bn == bnZero); break;
case OP_0NOTEQUAL: bn = (bn != bnZero); break;
+ default: assert(!"invalid opcode"); break;
}
popstack(stack);
stack.push_back(bn.getvch());
@@ -659,6 +660,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
case OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break;
case OP_MIN: bn = (bn1 < bn2 ? bn1 : bn2); break;
case OP_MAX: bn = (bn1 > bn2 ? bn1 : bn2); break;
+ default: assert(!"invalid opcode"); break;
}
popstack(stack);
popstack(stack);