[bugfix] using uninitializing variable

This commit is contained in:
Yuichi Nishiwaki 2014-06-28 20:45:41 +09:00
parent 39b1e6c6bc
commit c44803d238
1 changed files with 2 additions and 6 deletions

View File

@ -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