From 6b2942e7f06f6db20646153ccee362ac8a71c6d5 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 27 Oct 2020 20:11:03 +0000 Subject: [PATCH] [ewasm] Properly touch memory in EwasmInterpreter --- .../EwasmBuiltinInterpreter.cpp | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp b/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp index 39ec8ecfd..6d3f3a5f4 100644 --- a/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp +++ b/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp @@ -298,9 +298,7 @@ u256 EwasmBuiltinInterpreter::evalEthBuiltin(string const& _fun, vector 4) throw ExplicitlyTerminated(); + if (numberOfTopics > 0) + readBytes32(arg[3]); + if (numberOfTopics > 1) + readBytes32(arg[4]); + if (numberOfTopics > 2) + readBytes32(arg[5]); + if (numberOfTopics > 3) + readBytes32(arg[6]); logTrace(evmasm::logInstruction(numberOfTopics), {}); return 0; } @@ -473,7 +482,7 @@ u256 EwasmBuiltinInterpreter::evalEthBuiltin(string const& _fun, vector