summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-04-18 10:24:09 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-04-18 10:28:49 +0900
commit05fceb5992c20c30a6b31f89d2b0aa0f0698a9a2 (patch)
treef45f60324760f8bbf7eed8bd29db70fffa5e3d21 /src
parent82ab46139e6ee6bf664a5772cd83c37ed3bc17fe (diff)
downloadmruby-05fceb5992c20c30a6b31f89d2b0aa0f0698a9a2.tar.gz
mruby-05fceb5992c20c30a6b31f89d2b0aa0f0698a9a2.zip
Call exc_debug_info() in mrb_exc_set(); ref #3610
Otherwise line number information is lacked from exceptions raised in VM, e.g. "super called outside of method".
Diffstat (limited to 'src')
-rw-r--r--src/error.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/error.c b/src/error.c
index 2201fc840..ac11e4d8d 100644
--- a/src/error.c
+++ b/src/error.c
@@ -291,6 +291,10 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
}
else {
mrb->exc = mrb_obj_ptr(exc);
+ if (!mrb->gc.out_of_memory) {
+ exc_debug_info(mrb, mrb->exc);
+ mrb_save_backtrace(mrb);
+ }
}
}
@@ -301,10 +305,6 @@ mrb_exc_raise(mrb_state *mrb, mrb_value exc)
mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
}
mrb_exc_set(mrb, exc);
- if (!mrb->gc.out_of_memory) {
- exc_debug_info(mrb, mrb->exc);
- mrb_save_backtrace(mrb);
- }
if (!mrb->jmp) {
mrb_p(mrb, exc);
abort();