From 9c5e95ac4a9ded746dc5e76d78217139b14ccfe8 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Sun, 21 Dec 2008 05:31:04 +0000 Subject: [PATCH] better error message --- Robust/src/IR/State.java | 6 +++++- Robust/src/IR/Tree/SemanticCheck.java | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Robust/src/IR/State.java b/Robust/src/IR/State.java index 89322492..42c5bcd9 100644 --- a/Robust/src/IR/State.java +++ b/Robust/src/IR/State.java @@ -40,6 +40,7 @@ public class State { return optionaltaskdescriptors; } + /** Boolean flag which indicates whether compiler is compiling a task-based * program. */ public boolean WEBINTERFACE=false; @@ -87,6 +88,7 @@ public class State { private int arraycount=0; + private Hashtable> optionaltaskdescriptors; private Hashtable>> analysisresults; @@ -114,7 +116,9 @@ public class State { } public int getArrayNumber(TypeDescriptor td) { - return ((Integer)arraytonumber.get(td)).intValue(); + if (arraytonumber.containsKey(td)) + return ((Integer)arraytonumber.get(td)).intValue(); + else throw new Error("Could not find array type:" + td.toPrettyString()); } public int numArrays() { diff --git a/Robust/src/IR/Tree/SemanticCheck.java b/Robust/src/IR/Tree/SemanticCheck.java index 32577cc5..9bb7d55b 100644 --- a/Robust/src/IR/Tree/SemanticCheck.java +++ b/Robust/src/IR/Tree/SemanticCheck.java @@ -512,7 +512,6 @@ public class SemanticCheck { throw new Error("Bad lside in "+an.printNode(0)); checkExpressionNode(md, nametable, an.getDest(), null); - /* We want parameter variables to tasks to be immutable */ if (md instanceof TaskDescriptor) { if (an.getDest() instanceof NameNode) { @@ -539,7 +538,6 @@ public class SemanticCheck { } } - if (!postinc&&!typeutil.isSuperorType(an.getDest().getType(),an.getSrc().getType())) { throw new Error("Type of rside ("+an.getSrc().getType()+") not compatible with type of lside ("+an.getDest().getType()+")"+an.printNode(0)); } -- 2.34.1