From c44803d2381e77624742082123e42f8734b2875e Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 28 Jun 2014 20:45:41 +0900 Subject: [PATCH] [bugfix] using uninitializing variable --- src/var.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/var.c b/src/var.c index a779ddff..e667966d 100644 --- a/src/var.c +++ b/src/var.c @@ -48,10 +48,7 @@ get_var_from_proc(pic_state *pic, struct pic_proc *proc) { pic_value v; - if (! pic_proc_p(v)) { - goto typeerror; - } - if (! pic_proc_func_p(pic_proc_ptr(v))) { + if (! pic_proc_func_p(proc)) { goto typeerror; } if (pic_proc_cv_size(pic, proc) != 1) { @@ -64,8 +61,7 @@ get_var_from_proc(pic_state *pic, struct pic_proc *proc) return pic_var_ptr(v); typeerror: - pic_error(pic, "expected parameter"); - UNREACHABLE(); + pic_errorf(pic, "expected parameter, but got ~s", v); } static pic_value