From 2b31616ced2f8940956381cf3b61600981df3e17 Mon Sep 17 00:00:00 2001 From: jzhou Date: Wed, 5 Nov 2008 23:00:01 +0000 Subject: [PATCH] bug fixing --- Robust/src/ClassLibrary/Integer.java | 13 +++++++++++++ Robust/src/IR/Flat/BuildFlat.java | 10 +++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Robust/src/ClassLibrary/Integer.java b/Robust/src/ClassLibrary/Integer.java index b287800f..523acb2b 100644 --- a/Robust/src/ClassLibrary/Integer.java +++ b/Robust/src/ClassLibrary/Integer.java @@ -57,4 +57,17 @@ public class Integer { public String toString() { return String.valueOf(value); } + + public int hashCode() { + return value; + } + + public boolean equals(Object o) { + if (o.getType()!=getType()) + return false; + Integer s=(Integer)o; + if (s.intValue()!=this.value) + return false; + return true; + } } diff --git a/Robust/src/IR/Flat/BuildFlat.java b/Robust/src/IR/Flat/BuildFlat.java index 9562bd27..52f92b5c 100644 --- a/Robust/src/IR/Flat/BuildFlat.java +++ b/Robust/src/IR/Flat/BuildFlat.java @@ -415,7 +415,7 @@ public class BuildFlat { if (base!=null) { //If it is a preinc we need to store the initial value TempDescriptor src_tmp2=pre ? TempDescriptor.tempFactory("src",an.getDest().getType()) : out_temp; - TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3",an.getDest().getType()); + TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3_",an.getDest().getType()); FlatFieldNode ffn=new FlatFieldNode(fan.getField(), dst_tmp, src_tmp2); last.addNext(ffn); last=ffn; @@ -466,7 +466,7 @@ public class BuildFlat { if (base!=null) { //If it is a preinc we need to store the initial value TempDescriptor src_tmp2=pre ? TempDescriptor.tempFactory("src",an.getDest().getType()) : out_temp; - TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3",an.getDest().getType()); + TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3_",an.getDest().getType()); FlatElementNode fen=new FlatElementNode(dst_tmp, index_tmp, src_tmp2); last.addNext(fen); @@ -518,7 +518,7 @@ public class BuildFlat { if (base!=null) { //If it is a preinc we need to store the initial value TempDescriptor src_tmp2=pre ? TempDescriptor.tempFactory("src",an.getDest().getType()) : out_temp; - TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3",an.getDest().getType()); + TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3_",an.getDest().getType()); FlatFieldNode ffn=new FlatFieldNode(fan.getField(), dst_tmp, src_tmp2); last.addNext(ffn); @@ -559,7 +559,7 @@ public class BuildFlat { if (base!=null) { //If it is a preinc we need to store the initial value TempDescriptor src_tmp2=pre ? TempDescriptor.tempFactory("src",an.getDest().getType()) : out_temp; - TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3",an.getDest().getType()); + TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3_",an.getDest().getType()); FlatFieldNode ffn=new FlatFieldNode(nn.getField(), getTempforVar(nn.getVar()), src_tmp2); if (first==null) @@ -605,7 +605,7 @@ public class BuildFlat { if (base!=null) { //If it is a preinc we need to store the initial value TempDescriptor src_tmp2=getTempforVar(nn.getVar()); - TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3",an.getDest().getType()); + TempDescriptor tmp=TempDescriptor.tempFactory("srctmp3_",an.getDest().getType()); if (!pre) { FlatOpNode fon=new FlatOpNode(out_temp, src_tmp2, null, new Operation(Operation.ASSIGN)); if (first==null) -- 2.34.1