shithub: mc

Download patch

ref: bb3c52370a22d2fe3c0ad5c03d3914616ee0fb55
parent: ee1215bf65810716215fd068b52c07c43cd79d42
author: Ori Bernstein <[email protected]>
date: Tue Jun 18 10:55:36 EDT 2013

Simplify simplification code.

--- a/6/simp.c
+++ b/6/simp.c
@@ -1120,20 +1120,16 @@
             r = simptup(s, n, dst);
             break;
         case Oarr:
-            if (dst)
-                r = dst;
-            else
-                r = temp(s, n);
-            t = addr(s, r, exprtype(r));
+            if (!dst)
+                dst = temp(s, n);
+            t = addr(s, dst, exprtype(r));
             for (i = 0; i < n->expr.nargs; i++)
                 assignat(s, t, size(n->expr.args[i])*i, n->expr.args[i]);
             break;
         case Ostruct:
-            if (dst)
-                r = dst;
-            else
-                r = temp(s, n);
-            t = addr(s, r, exprtype(r));
+            if (!dst)
+                dst = temp(s, n);
+            t = addr(s, dst, exprtype(r));
             for (i = 0; i < n->expr.nargs; i++)
                 assignat(s, t, offset(n, n->expr.args[i]->expr.idx), n->expr.args[i]);
             break;