Fix implementation of signextend.

This commit is contained in:
chriseth 2019-02-26 17:55:30 +01:00
parent ebec54aacb
commit 514c9910aa

View File

@ -169,7 +169,7 @@ u256 EVMInstructionInterpreter::eval(
return arg[2] == 0 ? 0 : u256((u512(arg[0]) * u512(arg[1])) % arg[2]); return arg[2] == 0 ? 0 : u256((u512(arg[0]) * u512(arg[1])) % arg[2]);
case Instruction::SIGNEXTEND: case Instruction::SIGNEXTEND:
if (arg[0] >= 31) if (arg[0] >= 31)
return arg[0]; return arg[1];
else else
{ {
unsigned testBit = unsigned(arg[0]) * 8 + 7; unsigned testBit = unsigned(arg[0]) * 8 + 7;