From c2ed3bf11ee7362c8efd61a6b205b425524d796f Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Tue, 24 Jul 2018 12:25:21 -0700 Subject: [PATCH] mstore8 wants LSB of BE representation, i.e. last byte --- VMTests.md | 8 ++++---- nimbus/vm/interpreter/opcodes_impl.nim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VMTests.md b/VMTests.md index e35758d48..d95e6269f 100644 --- a/VMTests.md +++ b/VMTests.md @@ -403,7 +403,7 @@ OK: 33/52 Fail: 4/52 Skip: 15/52 + byte1.json OK calldatacopyMemExp.json Skip - codecopyMemExp.json Fail -- deadCode_1.json Fail ++ deadCode_1.json OK + dupAt51becameMload.json OK - extcodecopyMemExp.json Fail - for_loop1.json Fail @@ -449,7 +449,7 @@ OK: 33/52 Fail: 4/52 Skip: 15/52 + log1MemExp.json OK + loop_stacklimit_1020.json OK + loop_stacklimit_1021.json OK -- memory1.json Fail ++ memory1.json OK + mloadError0.json OK - mloadError1.json Fail + mloadMemExp.json OK @@ -463,7 +463,7 @@ OK: 33/52 Fail: 4/52 Skip: 15/52 + mstore8MemExp.json OK + mstore8WordToBigError.json OK + mstore8_0.json OK -- mstore8_1.json Fail ++ mstore8_1.json OK + mstoreMemExp.json OK + mstoreWordToBigError.json OK + mstore_mload0.json OK @@ -483,7 +483,7 @@ OK: 33/52 Fail: 4/52 Skip: 15/52 + swapAt52becameMstore.json OK + when.json OK ``` -OK: 131/145 Fail: 13/145 Skip: 1/145 +OK: 134/145 Fail: 10/145 Skip: 1/145 ## vmLogTest ```diff + log0_emptyMem.json OK diff --git a/nimbus/vm/interpreter/opcodes_impl.nim b/nimbus/vm/interpreter/opcodes_impl.nim index b3de716c2..a0c82638e 100644 --- a/nimbus/vm/interpreter/opcodes_impl.nim +++ b/nimbus/vm/interpreter/opcodes_impl.nim @@ -419,7 +419,7 @@ op mstore8, inline = true, memStartPos, value: ) computation.memory.extend(memPos, 1) - computation.memory.write(memPos, [value.toByteArrayBE[0]]) + computation.memory.write(memPos, [value.toByteArrayBE[31]]) op sload, inline = true, slot: ## 0x54, Load word from storage.