shithub: mc

Download patch

ref: 7f764bf844fa3630cbc8e2740fa2a1c8439c4067
parent: fc414618bf82fed12fb5fac9f1132bcc9dfb1557
author: Ori Bernstein <[email protected]>
date: Wed Jun 6 14:20:17 EDT 2012

Slices now pass down to instruction selection.

    We generate and return their value correctly in reduction.

--- a/8/reduce.c
+++ b/8/reduce.c
@@ -131,6 +131,7 @@
         case Tyslice:
             return 8; /* len; ptr */
         case Tyarray:
+            return 42;
         case Tytuple:
         case Tystruct:
             for (i = 0; i < t->nmemb; i++)
@@ -366,8 +367,9 @@
         case Oslice:
             args[1] = rval(s, args[1]);
             args[2] = rval(s, args[2]);
-            t = mkexpr(-1, Osub, args[2], args[1]);
+            t = mkexpr(-1, Osub, args[2], args[1], NULL);
             args[0] = slicebase(s, args[0], t);
+            r = n;
             break;
         case Oidx:
             t = idxaddr(s, n);