mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +00:00
LibWasm: Implement reference instructions (ref.{null,func,is_null})
This commit is contained in:
parent
7fb458b7c9
commit
56bf80251c
8 changed files with 73 additions and 9 deletions
|
@ -202,9 +202,11 @@ static bool pre_interpret_hook(Wasm::Configuration& config, Wasm::InstructionPoi
|
|||
warnln("Returned:");
|
||||
for (auto& value : result.values()) {
|
||||
auto str = value.value().visit(
|
||||
[&](const auto& value) {
|
||||
[&]<typename T>(const T& value) {
|
||||
if constexpr (requires { value.value(); })
|
||||
return String::formatted(" -> addr{} ", value.value());
|
||||
else if constexpr (IsSame<Wasm::Value::Null, T>)
|
||||
return String::formatted(" ->addr(null)");
|
||||
else
|
||||
return String::formatted(" -> {} ", value);
|
||||
});
|
||||
|
@ -460,9 +462,11 @@ int main(int argc, char* argv[])
|
|||
warnln("Returned:");
|
||||
for (auto& value : result.values()) {
|
||||
value.value().visit(
|
||||
[&](const auto& value) {
|
||||
[&]<typename T>(const T& value) {
|
||||
if constexpr (requires { value.value(); })
|
||||
out(" -> addr{} ", value.value());
|
||||
else if constexpr (IsSame<Wasm::Value::Null, T>)
|
||||
out(" ->addr(null)");
|
||||
else
|
||||
out(" -> {} ", value);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue