summaryrefslogtreecommitdiff
path: root/vm_args.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-09 05:22:51 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-09 05:22:51 +0000
commit3b7373fd00a0ba456498a7b7d6de2a47c96434a2 (patch)
tree6e1f16aabe8a9f0176d9fb7140caf113c76de626 /vm_args.c
parent976b6df9596a2077f09f6bed1796a02a229498d1 (diff)
downloadruby-3b7373fd00a0ba456498a7b7d6de2a47c96434a2.tar.gz
fix backtrace on argment error.
* vm_backtrace.c (rb_backtrace_use_iseq_first_lineno_for_last_location): added. It modifies last location's line as corresponding iseq's first line number. * vm_args.c (raise_argument_error): use added function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm_args.c b/vm_args.c
index 0dc626fd2d..2499632f7a 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -687,6 +687,8 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
return opt_pc;
}
+void rb_backtrace_use_iseq_first_lineno_for_last_location(VALUE self); /* vm_backtrace.c */
+
static void
raise_argument_error(rb_execution_context_t *ec, const rb_iseq_t *iseq, const VALUE exc)
{
@@ -698,6 +700,7 @@ raise_argument_error(rb_execution_context_t *ec, const rb_iseq_t *iseq, const VA
iseq->body->iseq_encoded,
ec->cfp->sp, 0, 0 /* stack_max */);
at = rb_ec_backtrace_object(ec);
+ rb_backtrace_use_iseq_first_lineno_for_last_location(at);
rb_vm_pop_frame(ec);
}
else {