From 514c9910aa4c4b02949c2e9560ae24372b48db85 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 26 Feb 2019 17:55:30 +0100 Subject: [PATCH] Fix implementation of signextend. --- test/tools/yulInterpreter/EVMInstructionInterpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp index 4b92edc18..b95e4bba8 100644 --- a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp +++ b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp @@ -169,7 +169,7 @@ u256 EVMInstructionInterpreter::eval( return arg[2] == 0 ? 0 : u256((u512(arg[0]) * u512(arg[1])) % arg[2]); case Instruction::SIGNEXTEND: if (arg[0] >= 31) - return arg[0]; + return arg[1]; else { unsigned testBit = unsigned(arg[0]) * 8 + 7;