mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
wasm: Don't try to print the function results if it traps
This commit is contained in:
parent
23b48f8fe1
commit
bacf5a7220
1 changed files with 10 additions and 8 deletions
|
@ -512,8 +512,9 @@ int main(int argc, char* argv[])
|
||||||
if (debug)
|
if (debug)
|
||||||
launch_repl();
|
launch_repl();
|
||||||
|
|
||||||
if (result.is_trap())
|
if (result.is_trap()) {
|
||||||
warnln("Execution trapped!");
|
warnln("Execution trapped: {}", result.trap().reason);
|
||||||
|
} else {
|
||||||
if (!result.values().is_empty())
|
if (!result.values().is_empty())
|
||||||
warnln("Returned:");
|
warnln("Returned:");
|
||||||
for (auto& value : result.values()) {
|
for (auto& value : result.values()) {
|
||||||
|
@ -523,6 +524,7 @@ int main(int argc, char* argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue