From: jjenista Date: Mon, 23 Feb 2009 23:16:52 +0000 (+0000) Subject: Catch Error objects at task and method level for reporting X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cdfd5210aa74829809ac341065e0fdc88faeca8d;p=IRC.git Catch Error objects at task and method level for reporting --- diff --git a/Robust/src/IR/Tree/SemanticCheck.java b/Robust/src/IR/Tree/SemanticCheck.java index d77cdb6f..59dba60c 100644 --- a/Robust/src/IR/Tree/SemanticCheck.java +++ b/Robust/src/IR/Tree/SemanticCheck.java @@ -64,14 +64,25 @@ public class SemanticCheck { Object obj=toanalyze.iterator().next(); if (obj instanceof TaskDescriptor) { toanalyze.remove(obj); - checkTask((TaskDescriptor)obj); + TaskDescriptor td=(TaskDescriptor)obj; + try { + checkTask(td); + } catch( Error e ) { + System.out.println( "Error in "+td ); + throw e; + } } else { ClassDescriptor cd=(ClassDescriptor)obj; toanalyze.remove(cd); checkClass(cd); for(Iterator method_it=cd.getMethods(); method_it.hasNext();) { MethodDescriptor md=(MethodDescriptor)method_it.next(); - checkMethodBody(cd,md); + try { + checkMethodBody(cd,md); + } catch( Error e ) { + System.out.println( "Error in "+md ); + throw e; + } } } } @@ -600,8 +611,7 @@ public class SemanticCheck { (an.getOperation().getBaseOp().getOp()!=Operation.POSTINC&& an.getOperation().getBaseOp().getOp()!=Operation.POSTDEC)) postinc=false; - - if (!postinc) + if (!postinc) checkExpressionNode(md, nametable, an.getSrc(),td); //TODO: Need check on validity of operation here if (!((an.getDest() instanceof FieldAccessNode)|| @@ -800,6 +810,9 @@ NextMethod: if (min.getExpression()!=null) { checkExpressionNode(md,nametable,min.getExpression(),null); typetolookin=min.getExpression().getType(); + //if (typetolookin==null) + //throw new Error(md+" has null return type"); + } else if (min.getBaseName()!=null) { String rootname=min.getBaseName().getRoot(); if (rootname.equals("super")) {