From: bdemsky Date: Mon, 14 Apr 2008 20:07:55 +0000 (+0000) Subject: Print out warning message instead of throwing exception if someone calls static metho... X-Git-Tag: preEdgeChange~170 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8f788bc3a1b9fd0cc31055819d303b73e823be31;p=IRC.git Print out warning message instead of throwing exception if someone calls static method on an object. --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index ed503d7e..3749ee24 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -1697,10 +1697,16 @@ public class BuildCode { output.print(objectparams.numPointers()); output.print(", & "+localsprefix); - if (fc.getThis()!=null) { + if (md.getThis()!=null) { output.print(", "); output.print("(struct "+md.getThis().getType().getSafeSymbol() +" *)"+ generateTemp(fm,fc.getThis(),lb)); } + if (fc.getThis()!=null&&md.getThis()==null) { + System.out.println("WARNING!!!!!!!!!!!!"); + System.out.println("Source code calls static method"+md+"on an object in "+fm.getMethod()+"!"); + } + + for(int i=0;i