File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -640,6 +640,7 @@ my class MASTCompilerInstance {
640
640
}
641
641
}
642
642
643
+ # this method is a hook point so that we can override serialization when cross-compiling
643
644
method serialize_sc ($ sc ) {
644
645
# Serialize it.
645
646
my $ sh := nqp ::list_s();
@@ -648,7 +649,7 @@ my class MASTCompilerInstance {
648
649
# Now it's serialized, pop this SC off the compiling SC stack.
649
650
nqp ::popcompsc();
650
651
651
- [$ serialized ,$ sh ];
652
+ [$ serialized , nqp ::null() ];
652
653
}
653
654
654
655
method deserialization_code ($ sc , @ code_ref_blocks , $ repo_conf_res ) {
@@ -657,14 +658,21 @@ my class MASTCompilerInstance {
657
658
my $ sh := $ sc_tuple [1 ];
658
659
659
660
# String heap QAST.
660
- my $ sh_ast := QAST ::Op. new ( : op(' list_s' ) );
661
- my $ sh_elems := nqp :: elems ($ sh );
662
- my $ i := 0 ;
663
- while $ i < $ sh_elems {
664
- $ sh_ast . push (nqp ::isnull_s(nqp ::atpos_s($ sh , $ i ))
665
- ?? QAST ::Op. new ( : op(' null_s' ) )
666
- !! QAST ::SVal. new ( : value(nqp ::atpos_s($ sh , $ i )) ));
667
- $ i := $ i + 1 ;
661
+ my $ sh_ast ;
662
+
663
+ if nqp ::islist($ sh ) {
664
+ $ sh_ast := QAST ::Op. new ( : op(' list_s' ) );
665
+ my $ sh_elems := nqp :: elems ($ sh );
666
+ my $ i := 0 ;
667
+ while $ i < $ sh_elems {
668
+ $ sh_ast . push (nqp ::isnull_s(nqp ::atpos_s($ sh , $ i ))
669
+ ?? QAST ::Op. new ( : op(' null_s' ) )
670
+ !! QAST ::SVal. new ( : value(nqp ::atpos_s($ sh , $ i )) ));
671
+ $ i := $ i + 1 ;
672
+ }
673
+ }
674
+ else {
675
+ $ sh_ast := QAST ::Op. new ( : op(' null' ) );
668
676
}
669
677
670
678
# Code references.
You can’t perform that action at this time.
0 commit comments