fixed a flaw in post_lambda() in the compiler code

This commit is contained in:
hyung-hwan 2021-02-01 13:26:48 +00:00
parent 2d22b53c96
commit 770de52eba

View File

@ -3087,14 +3087,14 @@ static HCL_INLINE int post_lambda (hcl_t* hcl)
if (find_temporary_variable_backward(hcl, HCL_CNODE_GET_TOK(defun_name), &index) <= -1) if (find_temporary_variable_backward(hcl, HCL_CNODE_GET_TOK(defun_name), &index) <= -1)
{ {
SWITCH_TOP_CFRAME (hcl, COP_EMIT_SET, defun_name); SWITCH_TOP_CFRAME (hcl, COP_EMIT_SET, defun_name);
cf = GET_SUBCFRAME(hcl); cf = GET_TOP_CFRAME(hcl);
cf->u.set.var_type = VAR_NAMED; cf->u.set.var_type = VAR_NAMED;
} }
else else
{ {
HCL_ASSERT (hcl, index <= HCL_SMOOI_MAX); HCL_ASSERT (hcl, index <= HCL_SMOOI_MAX);
SWITCH_TOP_CFRAME (hcl, COP_EMIT_SET, defun_name); SWITCH_TOP_CFRAME (hcl, COP_EMIT_SET, defun_name);
cf = GET_SUBCFRAME(hcl); cf = GET_TOP_CFRAME(hcl);
cf->u.set.var_type = VAR_INDEXED; cf->u.set.var_type = VAR_INDEXED;
cf->u.set.index = index; cf->u.set.index = index;
} }