]> Nishi Git Mirror - gwion.git/commitdiff
:art: Fix switch
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sat, 16 Feb 2019 11:42:00 +0000 (12:42 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sat, 16 Feb 2019 11:42:00 +0000 (12:42 +0100)
src/emit/emit.c
src/oo/switch.c

index 53445025c2178d4797fc79e2ff72ad41322b2a53..41c4d37258e54b6b0eab5e6545d1fcb98d4766e6 100644 (file)
@@ -1155,7 +1155,8 @@ ANN static m_bool emit_stmt_switch(const Emitter emit, const Stmt_Switch stmt) {
   CHECK_BB(emit_exp(emit, stmt->val, 0))
   const Instr instr = emit_add_instr(emit, BranchSwitch);
   instr->m_val2 = (m_uint)switch_map(emit->env);
-  CHECK_BB(scoped_stmt(emit, stmt->stmt, 1))
+//  CHECK_BB(scoped_stmt(emit, stmt->stmt, 1))
+  CHECK_BB(emit_stmt(emit, stmt->stmt, 1))
   instr->m_val = switch_idx(emit->env) ?: emit_code_size(emit);
   if(push) {
     emit_switch_map(push, (Map)instr->m_val2);
index 4fa98087db52cbe88f6028c9dc634f2e99012173..ec2389778eff5cdf30823d3e32c59e0de31aee24 100644 (file)
@@ -141,7 +141,7 @@ ANN Map switch_map(const Env env) {
 
 ANN Vector switch_vec(const Env env) {
   const Switch sw = (Switch)vector_back((Vector)&env->swi);
-  return sw->vec; // new_vector(); // dyn only
+  return vector_copy(sw->vec); // new_vector(); // dyn only
 }
 
 ANN m_uint switch_idx(const Env env) {