const Instr assign = emit_add_instr(emit, ObjectAssign);
assign->m_val = emit_var;
const size_t missing_depth = type->array_depth - (array ? array->depth : 0);
-// if((is_array || missing_depth) && !emit->env->scope->depth)
-// ADD_REF(type)
+ if((is_array || missing_depth) && !emit->env->scope->depth)
+ ADD_REF(type)
if(missing_depth) {
const Instr push = emit_add_instr(emit, Reg2Reg);
push->m_val = -(1 + missing_depth) * SZ_INT;
#include "parser.h"
static FREEARG(freearg_switchini) {
- free_vector(((Gwion)gwion)->p, (Vector)instr->m_val);
- free_map(((Gwion)gwion)->p, (Map)instr->m_val2);
+ if(instr->m_val)
+ free_vector(((Gwion)gwion)->p, (Vector)instr->m_val);
+ if(instr->m_val2)
+ free_map(((Gwion)gwion)->p, (Map)instr->m_val2);
}
static FREEARG(freearg_switchbranch) {
}
free_loc(vm->gwion->p, gwi.loc);
return GW_OK;
-}
\ No newline at end of file
+}
gwi_item_ini(gwi, "time", "t_zero");
gwi_item_end(gwi, ae_flag_const, t_zero);
gwi_item_ini(gwi, "@now", "now");
- gwi_item_end(gwi, 0, NULL);
+ gwi_item_end(gwi, ae_flag_const, NULL);
return GW_OK;
}
CHECK_FF(chuck, rassign, r_assign)
CHECK_BB(gwi_oper_end(gwi, op_add, FloatPlus))
CHECK_BB(gwi_oper_ini(gwi, "dur", "@now", "time"))
- _CHECK_OP(chuck, rassign, Time_Advance)
+ _CHECK_OP(chuck, rhs_emit_var, Time_Advance)
CHECK_BB(gwi_oper_ini(gwi, "@now", "@now", NULL))
_CHECK_OP(chuck, chuck_now, NULL)
CHECK_BB(gwi_oper_ini(gwi, NULL, "@now", NULL))