From d8d7b4efb0e9afc09e0d40ce85fa7c6917514017 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 25 Mar 2008 01:48:08 +0000 Subject: [PATCH] correct bug in new code --- Robust/src/IR/Flat/BuildCode.java | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 1342ab10..19e39ccf 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -1444,6 +1444,7 @@ public class BuildCode { output.println("{"); output.println("/* prefetch */"); output.println("void * prefptr;"); + output.println("int tmpindex;"); for(Iterator it = fpn.hspp.iterator();it.hasNext();) { PrefetchPair pp = (PrefetchPair) it.next(); Integer statusbase = locality.getNodePreTempInfo(lb,fpn).get(pp.base); @@ -1527,30 +1528,35 @@ public class BuildCode { !pp.base.equals(fm.getParameter(0)); for(int i=0;i"+fd.getSafeSymbol(); + } else { + basestr=basestr+"->"+fd.getSafeSymbol(); + maybenull=true; + } lasttype=fd.getType(); } else { IndexDescriptor id=(IndexDescriptor)desc; - nextop="["; + indexcheck="(tmpindex="; for(int j=0;j0)&&(tmpindex<((struct ArrayObject *)prefptr)->___length___)"; + if (!teststr.equals("")) teststr+="&&"; - teststr+="prefptr="+basestr; - basestr="prefptr"+nextop; - } else { - basestr+=nextop; + teststr+="prefptr="+basestr+"&&"+indexcheck; + basestr="((void **)(((char *) &(((struct ArrayObject*)prefptr)->___length___))+sizeof(int)))[tmpindex])"; maybenull=true; + lasttype=lasttype.dereference(); } } -- 2.34.1