Merge pull request #8060 from ethereum/yul-interp-fix

Fix getExternalCodeSize in the Yul Ewasm interpreter
This commit is contained in:
Alex Beregszaszi 2019-12-18 23:14:48 +00:00 committed by GitHub
commit 8511012e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,7 +286,8 @@ u256 EWasmBuiltinInterpreter::evalBuiltin(YulString _fun, vector<u256> const& _a
return 0;
}
else if (_fun == "eth.getExternalCodeSize"_yulstring)
return u256(keccak256(h256(readAddress(arg[0])))) & 0xffffff;
// Generate "random" code length. Make sure it fits the page size.
return u256(keccak256(h256(readAddress(arg[0])))) & 0xfff;
else if (_fun == "eth.getGasLeft"_yulstring)
return 0x99;
else if (_fun == "eth.getBlockGasLimit"_yulstring)