From 0650e2a6775e5b1bf26cc28047d214d8a3520127 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 6 Apr 2006 00:35:33 +0000 Subject: [PATCH] Fixed --- Robust/src/IR/Flat/BuildCode.java | 1 - Robust/src/IR/TypeUtil.java | 12 ++++++++++-- Robust/src/Main/Main.java | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 05d1cdc1..cf269d1f 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -491,7 +491,6 @@ public class BuildCode { if (fc.getReturnTemp()!=null) output.print(generateTemp(fm,fc.getReturnTemp())+"="); - if (md.isStatic()||md.getReturnType()==null||singleCall(fc.getThis().getType().getClassDesc(),md)) { output.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()); } else { diff --git a/Robust/src/IR/TypeUtil.java b/Robust/src/IR/TypeUtil.java index 3a3cf8d8..fcf7a63e 100644 --- a/Robust/src/IR/TypeUtil.java +++ b/Robust/src/IR/TypeUtil.java @@ -20,7 +20,6 @@ public class TypeUtil { private void createTables() { supertable=new Hashtable(); - subclasstable=new Hashtable(); Iterator classit=state.getClassSymbolTable().getDescriptorsIterator(); while(classit.hasNext()) { @@ -30,8 +29,17 @@ public class TypeUtil { ClassDescriptor cd_super=getClass(superc); supertable.put(cd,cd_super); } - + } + } + + public void createFullTable() { + subclasstable=new Hashtable(); + + Iterator classit=state.getClassSymbolTable().getDescriptorsIterator(); + while(classit.hasNext()) { + ClassDescriptor cd=(ClassDescriptor)classit.next(); ClassDescriptor tmp=cd.getSuperDesc(); + while(tmp!=null) { if (!subclasstable.containsKey(tmp)) subclasstable.put(tmp,new HashSet()); diff --git a/Robust/src/Main/Main.java b/Robust/src/Main/Main.java index cc28e001..731398b3 100644 --- a/Robust/src/Main/Main.java +++ b/Robust/src/Main/Main.java @@ -49,7 +49,8 @@ public class Main { SemanticCheck sc=new SemanticCheck(state,tu); sc.semanticCheck(); - + tu.createFullTable(); + BuildFlat bf=new BuildFlat(state); bf.buildFlat(); -- 2.34.1