From: yeom Date: Fri, 9 Apr 2010 20:42:27 +0000 (+0000) Subject: fix in generating dynamic variable type. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b71351acb5fbc55d3ddc10503e14a03578018559;p=IRC.git fix in generating dynamic variable type. --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 1aa30566..0f8df474 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -2688,9 +2688,20 @@ public class BuildCode { } else { fmContext = currentSESE.getfmBogus(); } + + TypeDescriptor type=dynVar.getType(); + String typeStr; + if( type.isNull() ) { + typeStr = "void*"; + } else if( type.isClass() || type.isArray() ) { + typeStr = "struct "+type.getSafeSymbol()+"*"; + } else { + typeStr = type.getSafeSymbol(); + } + output.println(" "+generateTemp( fmContext, dynVar, null )+ - " = *(("+dynVar.getType()+"*) ("+ - dynVar+"_srcSESE + "+dynVar+"_srcOffset));"); + " = *(("+typeStr+"*) ("+ + dynVar+"_srcSESE + "+dynVar+"_srcOffset));"); output.println(" }"); output.println(" }");