Fix implementation of getCodeSize in Ewasm

This commit is contained in:
Alex Beregszaszi 2019-12-18 14:56:29 +00:00
parent b3caf35e88
commit 7d3ccee921
4 changed files with 2 additions and 5 deletions

View File

@ -401,8 +401,7 @@ function calldatacopy(x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4) {
// Needed?
function codesize() -> z1, z2, z3, z4 {
eth.getCodeSize(0)
z1, z2, z3, z4 := mload_internal(0)
z4 := eth.getCodeSize()
}
function codecopy(x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4) {
eth.codeCopy(

View File

@ -120,7 +120,7 @@ void WasmDialect::addEthereumExternals()
{"getCaller", {i32ptr}, {}},
{"getCallValue", {i32ptr}, {}},
{"codeCopy", {i32ptr, i32, i32}, {}},
{"getCodeSize", {i32ptr}, {}},
{"getCodeSize", {}, {i32}},
{"getBlockCoinbase", {i32ptr}, {}},
{"create", {i32ptr, i32ptr, i32, i32ptr}, {i32}},
{"getBlockDifficulty", {i32ptr}, {}},

View File

@ -7,6 +7,5 @@
// Trace:
// INVALID()
// Memory dump:
// 0: 0000000000000000000000000000000000000000000000000000000000000014
// 40: 636f6465636f6465636f6465636f6465636f6465000000000000000000000000
// Storage dump:

View File

@ -9,6 +9,5 @@
// Trace:
// INVALID()
// Memory dump:
// 0: 0000000000000000000000000000000000000000000000000000000000000014
// 80: 636f6465636f6465636f6465636f6465636f6465000000000000000000000000
// Storage dump: