aboutsummaryrefslogtreecommitdiffstats
path: root/eval_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval_error.c')
-rw-r--r--eval_error.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/eval_error.c b/eval_error.c
index 3ad2915ccc..8a5ef273c1 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -25,12 +25,13 @@ error_pos(void)
int sourceline = rb_sourceline();
if (sourcefile) {
+ ID caller_name;
if (sourceline == 0) {
warn_printf("%s", sourcefile);
}
- else if (rb_frame_callee()) {
+ else if ((caller_name = rb_frame_callee()) != 0) {
warn_printf("%s:%d:in `%s'", sourcefile, sourceline,
- rb_id2name(rb_frame_callee()));
+ rb_id2name(caller_name));
}
else {
warn_printf("%s:%d", sourcefile, sourceline);