added 'class_push_exit'
enhanced the compiler to produce 'pop_stacktop' at the end of the class if the class body is not empty
This commit is contained in:
17
lib/exec.c
17
lib/exec.c
@ -3367,16 +3367,21 @@ if (do_throw(hcl, hcl->_nil, fetched_instruction_pointer) <= -1)
|
||||
|
||||
case HCL_CODE_CLASS_EXIT:
|
||||
{
|
||||
hcl_oop_t c;
|
||||
|
||||
LOG_INST_0 (hcl, "class_exit");
|
||||
/* TODO: stack underflow check? */
|
||||
#if 0
|
||||
HCL_CLSTACK_POP (hcl);
|
||||
break;
|
||||
}
|
||||
|
||||
case HCL_CODE_CLASS_PUSH_EXIT:
|
||||
{
|
||||
hcl_oop_t c;
|
||||
|
||||
LOG_INST_0 (hcl, "class_push_exit");
|
||||
/* TODO: stack underflow check? */
|
||||
HCL_CLSTACK_POP_TO (hcl, c);
|
||||
HCL_STACK_PUSH (hcl, c);
|
||||
#else
|
||||
HCL_CLSTACK_POP (hcl);
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
/* -------------------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user