From 4e8317f5df061db63600113123a83c6572f6c63f Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Mon, 3 Sep 2012 15:33:35 +0900 Subject: do no generate lineno info if no filename is specified --- src/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/error.c') diff --git a/src/error.c b/src/error.c index da8786650..6d05a3c6c 100644 --- a/src/error.c +++ b/src/error.c @@ -191,7 +191,7 @@ exc_debug_info(mrb_state *mrb, struct RObject *exc) if (ci->proc && !MRB_PROC_CFUNC_P(ci->proc)) { mrb_irep *irep = ci->proc->body.irep; - if (irep->lines && irep->iseq <= pc && pc < irep->iseq + irep->ilen) { + if (irep->filename && irep->lines && irep->iseq <= pc && pc < irep->iseq + irep->ilen) { mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "file"), mrb_str_new_cstr(mrb, irep->filename)); mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "line"), mrb_fixnum_value(irep->lines[pc - irep->iseq - 1])); return; -- cgit v1.2.3