mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-23 15:23:44 +02:00
Rescue all Ruby errors in libretro builds instead of only StandardError
s
`rb_rescue` only catches `StandardError`s, which doesn't include things like Ruby syntax errors that we'd like to catch. We need to explicitly use `rb_rescue2` to catch `Exception` in order to catch everything.
This commit is contained in:
parent
06819fb9a9
commit
dae17511aa
2 changed files with 2 additions and 2 deletions
|
@ -87,7 +87,7 @@ namespace mkxp_sandbox {
|
|||
SANDBOX_AWAIT_AND_SET(value, rb_class_new_instance, 0, NULL, sb()->rb_cArray());
|
||||
SANDBOX_AWAIT(rb_ary_push, value, string);
|
||||
SANDBOX_AWAIT(rb_ary_push, value, filename);
|
||||
SANDBOX_AWAIT_AND_SET(value, rb_rescue, func, value, rescue, SANDBOX_NIL);
|
||||
SANDBOX_AWAIT_AND_SET(value, rb_rescue2, func, value, rescue, SANDBOX_NIL, sb()->rb_eException(), 0);
|
||||
}
|
||||
|
||||
return value;
|
||||
|
|
|
@ -145,7 +145,7 @@ static VALUE rescue(VALUE arg, VALUE exception) {
|
|||
SANDBOX_COROUTINE(main,
|
||||
void operator()() {
|
||||
BOOST_ASIO_CORO_REENTER (this) {
|
||||
SANDBOX_AWAIT(rb_rescue, func, 0, rescue, 0);
|
||||
SANDBOX_AWAIT(rb_rescue2, func, 0, rescue, 0, sb()->rb_eException(), 0);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue