mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add some missing wasm functions.
This commit is contained in:
parent
a7624ffc45
commit
48933df18d
@ -311,7 +311,11 @@ bytes BinaryTransform::operator()(BuiltinCall const& _call)
|
|||||||
bytes args = visit(_call.arguments);
|
bytes args = visit(_call.arguments);
|
||||||
|
|
||||||
if (_call.functionName == "unreachable")
|
if (_call.functionName == "unreachable")
|
||||||
return toBytes(Opcode::Unreachable);
|
return toBytes(Opcode::Unreachable);
|
||||||
|
else if (_call.functionName == "nop")
|
||||||
|
return toBytes(Opcode::Nop);
|
||||||
|
else if (_call.functionName == "drop")
|
||||||
|
return toBytes(Opcode::Drop);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yulAssert(builtins.count(_call.functionName), "Builtin " + _call.functionName + " not found");
|
yulAssert(builtins.count(_call.functionName), "Builtin " + _call.functionName + " not found");
|
||||||
|
@ -94,6 +94,7 @@ WasmDialect::WasmDialect()
|
|||||||
// We could introduce "i32.drop".
|
// We could introduce "i32.drop".
|
||||||
addFunction("drop", {i64}, {});
|
addFunction("drop", {i64}, {});
|
||||||
|
|
||||||
|
addFunction("nop", {}, {});
|
||||||
addFunction("unreachable", {}, {}, false);
|
addFunction("unreachable", {}, {}, false);
|
||||||
m_functions["unreachable"_yulstring].sideEffects.invalidatesStorage = false;
|
m_functions["unreachable"_yulstring].sideEffects.invalidatesStorage = false;
|
||||||
m_functions["unreachable"_yulstring].sideEffects.invalidatesMemory = false;
|
m_functions["unreachable"_yulstring].sideEffects.invalidatesMemory = false;
|
||||||
|
@ -93,7 +93,7 @@ u256 EwasmBuiltinInterpreter::evalBuiltin(YulString _fun, vector<u256> const& _a
|
|||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (_fun == "drop"_yulstring)
|
else if (_fun == "drop"_yulstring || _fun == "nop"_yulstring)
|
||||||
return {};
|
return {};
|
||||||
else if (_fun == "i32.wrap_i64"_yulstring)
|
else if (_fun == "i32.wrap_i64"_yulstring)
|
||||||
return arg.at(0) & uint32_t(-1);
|
return arg.at(0) & uint32_t(-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user