Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | bool fEnabledOpCodesMagnetic = | ||||
(flags & SCRIPT_ENABLE_MAGNETIC_OPCODES) != 0; | (flags & SCRIPT_ENABLE_MAGNETIC_OPCODES) != 0; | ||||
if (fEnabledOpCodesMagnetic) { | if (fEnabledOpCodesMagnetic) { | ||||
switch (opcode) { | switch (opcode) { | ||||
case OP_INVERT: | case OP_INVERT: | ||||
return true; | return true; | ||||
case OP_MUL: | case OP_MUL: | ||||
return true; | return false; | ||||
case OP_LSHIFT: | case OP_LSHIFT: | ||||
return true; | return true; | ||||
case OP_RSHIFT: | case OP_RSHIFT: | ||||
return true; | return true; | ||||
default: | default: | ||||
▲ Show 20 Lines • Show All 616 Lines • ▼ Show 20 Lines | try { | ||||
break; | break; | ||||
} | } | ||||
popstack(stack); | popstack(stack); | ||||
stack.push_back(bn.getvch()); | stack.push_back(bn.getvch()); | ||||
} break; | } break; | ||||
case OP_ADD: | case OP_ADD: | ||||
case OP_SUB: | case OP_SUB: | ||||
case OP_MUL: | |||||
case OP_DIV: | case OP_DIV: | ||||
case OP_MOD: | case OP_MOD: | ||||
case OP_BOOLAND: | case OP_BOOLAND: | ||||
case OP_BOOLOR: | case OP_BOOLOR: | ||||
case OP_NUMEQUAL: | case OP_NUMEQUAL: | ||||
case OP_NUMEQUALVERIFY: | case OP_NUMEQUALVERIFY: | ||||
case OP_NUMNOTEQUAL: | case OP_NUMNOTEQUAL: | ||||
case OP_LESSTHAN: | case OP_LESSTHAN: | ||||
Show All 14 Lines | try { | ||||
case OP_ADD: | case OP_ADD: | ||||
bn = bn1 + bn2; | bn = bn1 + bn2; | ||||
break; | break; | ||||
case OP_SUB: | case OP_SUB: | ||||
bn = bn1 - bn2; | bn = bn1 - bn2; | ||||
break; | break; | ||||
case OP_MUL: | |||||
schancel: I was under the impression there was some overflow issue that needed to be addressed? | |||||
danconnollyAuthorUnsubmitted Done Inline ActionsI've updated the revision description to describe the potential for overflow and the related tests. danconnolly: I've updated the revision description to describe the potential for overflow and the related… | |||||
bn = bn1 * bn2; | |||||
break; | |||||
case OP_DIV: | case OP_DIV: | ||||
// denominator must not be 0 | // denominator must not be 0 | ||||
if (bn2 == 0) { | if (bn2 == 0) { | ||||
return set_error(serror, | return set_error(serror, | ||||
SCRIPT_ERR_DIV_BY_ZERO); | SCRIPT_ERR_DIV_BY_ZERO); | ||||
} | } | ||||
bn = bn1 / bn2; | bn = bn1 / bn2; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 925 Lines • Show Last 20 Lines |
I was under the impression there was some overflow issue that needed to be addressed?