summaryrefslogtreecommitdiff
path: root/eval_error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-24 22:03:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-24 22:03:41 +0000
commit37b862c6371f3fa4b8201ce0a3420e3f75d899e0 (patch)
treed8d80dee77885253070948b3a5fdecc0966cae9f /eval_error.c
parentbea632a0168ca1238342e93809f3889336b889e7 (diff)
call rb_frame_callee() only once
* eval_error.c (error_pos): no needs to call rb_frame_callee() twice. * safe.c (rb_secure, rb_insecure_operation): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 3ad2915..8a5ef27 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);