From 6ac750551ec6b36986f49a824c491081c0270399 Mon Sep 17 00:00:00 2001 From: andri lim Date: Mon, 12 Aug 2019 18:22:22 +0700 Subject: [PATCH] 'SAR' opcode uses new 'shr' from stint --- nimbus/vm/interpreter/opcodes_impl.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nimbus/vm/interpreter/opcodes_impl.nim b/nimbus/vm/interpreter/opcodes_impl.nim index 9ce17783f..3a2daa04f 100644 --- a/nimbus/vm/interpreter/opcodes_impl.nim +++ b/nimbus/vm/interpreter/opcodes_impl.nim @@ -898,6 +898,7 @@ op shrOp, inline = true, shift, num: if shiftLen >= 256: push: 0 else: + # uint version of `shr` push: num shr shiftLen op sarOp, inline = true: @@ -909,7 +910,9 @@ op sarOp, inline = true: else: push: 0 else: - push: cast[Uint256](ashr(num, shiftLen)) + # int version of `shr` then force the result + # into uint256 + push: cast[Uint256](num shr shiftLen) op extCodeHash, inline = true: let address = computation.stack.popAddress()