Fixed backtrace message for top-level blocks; fix #4936

In top-level, `mid` is `NULL`. We used to ignore 'mid` update for `NULL`.
parent 59464f35
...@@ -1500,8 +1500,7 @@ RETRY_TRY_BLOCK: ...@@ -1500,8 +1500,7 @@ RETRY_TRY_BLOCK:
mrb_sym mid; mrb_sym mid;
struct REnv *e = MRB_PROC_ENV(m); struct REnv *e = MRB_PROC_ENV(m);
mid = e->mid; ci->mid = mid = e->mid;
if (mid) ci->mid = mid;
if (!e->stack) { if (!e->stack) {
e->stack = mrb->c->stack; e->stack = mrb->c->stack;
} }
......
...@@ -400,7 +400,7 @@ assert('GC in rescue') do ...@@ -400,7 +400,7 @@ assert('GC in rescue') do
end end
rescue => exception rescue => exception
GC.start GC.start
assert_equal("#{__FILE__}:#{line}:in call", assert_equal("#{__FILE__}:#{line}",
exception.backtrace.first) exception.backtrace.first)
end end
end end
...@@ -418,7 +418,7 @@ assert('Method call in rescue') do ...@@ -418,7 +418,7 @@ assert('Method call in rescue') do
rescue => exception rescue => exception
[3].each do [3].each do
end end
assert_equal("#{__FILE__}:#{line}:in call", assert_equal("#{__FILE__}:#{line}",
exception.backtrace.first) exception.backtrace.first)
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment