mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10121 from ethereum/ewasm-stop
[ewasm] Implement stop() in EVM->Ewasm translator
This commit is contained in:
commit
9b353103b4
@ -356,11 +356,15 @@ bytes BinaryTransform::operator()(BuiltinCall const& _call)
|
||||
if (_call.functionName == "dataoffset")
|
||||
{
|
||||
string name = get<StringLiteral>(_call.arguments.at(0)).value;
|
||||
// TODO: support the case where name refers to the current object
|
||||
yulAssert(m_subModulePosAndSize.count(name), "");
|
||||
return toBytes(Opcode::I64Const) + lebEncodeSigned(static_cast<int64_t>(m_subModulePosAndSize.at(name).first));
|
||||
}
|
||||
else if (_call.functionName == "datasize")
|
||||
{
|
||||
string name = get<StringLiteral>(_call.arguments.at(0)).value;
|
||||
// TODO: support the case where name refers to the current object
|
||||
yulAssert(m_subModulePosAndSize.count(name), "");
|
||||
return toBytes(Opcode::I64Const) + lebEncodeSigned(static_cast<int64_t>(m_subModulePosAndSize.at(name).second));
|
||||
}
|
||||
|
||||
|
@ -1211,6 +1211,9 @@ function revert(x1, x2, x3, x4, y1, y2, y3, y4) {
|
||||
function invalid() {
|
||||
unreachable()
|
||||
}
|
||||
function stop() {
|
||||
eth.finish(0:i32, 0:i32)
|
||||
}
|
||||
function memoryguard(x:i64) -> y1, y2, y3, y4 {
|
||||
y4 := x
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user