diff Paper/src/dispatch.c @ 41:de0f0fa18b71

fix c source
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Fri, 09 Nov 2018 13:49:33 +0900
parents fb4c1b408c9f
children
line wrap: on
line diff
--- a/Paper/src/dispatch.c	Fri Nov 09 13:31:27 2018 +0900
+++ b/Paper/src/dispatch.c	Fri Nov 09 13:49:33 2018 +0900
@@ -9,4 +9,17 @@
                 GET_REG(cur_op, 0).i64 = MVM_BC_get_I64(cur_op, 2);
                 cur_op += 10;
                 goto NEXT;
+            OP(pushcompsc): {    
+                MVMObject * const sc  = GET_REG(cur_op, 0).o;
+                if (REPR(sc)->ID != MVM_REPR_ID_SCRef)
+                    MVM_exception_throw_adhoc(tc, "Can only push an SCRef with pushcompsc");
+                if (MVM_is_null(tc, tc->compiling_scs)) {
+                    MVMROOT(tc, sc, {
+                        tc->compiling_scs = MVM_repr_alloc_init(tc, tc->instance->boot_types.BOOTArray);
+                    });  
+                }    
+                MVM_repr_unshift_o(tc, tc->compiling_scs, sc); 
+                cur_op += 2;
+                goto NEXT;
+            }    
         }