on master help sign in
Allow CDATA to be copied to other VMs

When using `fork` with access to a CData reference, the RTS will panic on the assertion that it was unable to match the type of the closure in doCopyTo. This is because of a missing case for CData. This change copies the paradigm for other type tags of Closures for CData.

commitd07bcd96bfdfa48773aa9eac4e21bd6a0ecdab5a authorAlex Feldman-Crough <alex@fldcr.com> dateThu 7 Jul 2016, 08:01 (10 years ago) parent12c70f5
1 file changed+3
rts/idris_rts.c+3
rts/idris_rts.c+3
@@ -792,6 +792,9 @@ VAL doCopyTo(VM* vm, VAL x) {
792792 case CT_MANAGEDPTR:
793793 cl = MKMPTRc(vm, x->info.mptr->data, x->info.mptr->size);
794794 break;
795+ case CT_CDATA:
796+ cl = MKCDATAc(vm, x->info.c_heap_item);
797+ break;
795798 case CT_BITS8:
796799 cl = idris_b8CopyForGC(vm, x);
797800 break;