shithub: mc

Download patch

ref: 16f5afe322e39f1716716700188664305b829d59
parent: bb49dad224c9d89f9945362c79920d56bb2b578e
author: Ori Bernstein <[email protected]>
date: Wed Oct 24 11:57:15 EDT 2012

Simplify offset in slice base.

--- a/6/simp.c
+++ b/6/simp.c
@@ -657,7 +657,7 @@
     }
     /* safe: all types we allow here have a sub[0] that we want to grab */
     if (off) {
-      off = ptrsized(s, off);
+      off = ptrsized(s, rval(s, off, NULL));
       sz = tysize(n->expr.type->sub[0]);
       v = mul(off, disp(n->line, sz));
       return add(u, v);