From b71351acb5fbc55d3ddc10503e14a03578018559 Mon Sep 17 00:00:00 2001 From: yeom Date: Fri, 9 Apr 2010 20:42:27 +0000 Subject: [PATCH] fix in generating dynamic variable type. --- Robust/src/IR/Flat/BuildCode.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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(" }"); -- 2.34.1