fixes to adding default values when desired
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@925 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
66a83b0e3c
commit
5483465978
|
@ -1184,8 +1184,10 @@ public abstract class AstTranslator extends CAstVisitor {
|
|||
protected Symbol makeSymbol(final String nm, final boolean isFinal, final Object defaultInitValue, int vn, Scope definer) {
|
||||
final int v = vn == -1 ? getUnderlyingSymtab().newSymbol() : vn;
|
||||
if (useDefaultInitValues() && defaultInitValue != null) {
|
||||
if (getUnderlyingSymtab().getValue(v) == null) {
|
||||
getUnderlyingSymtab().setDefaultValue(v, defaultInitValue);
|
||||
}
|
||||
}
|
||||
return new AbstractSymbol(definer, isFinal, defaultInitValue) {
|
||||
public String toString() {
|
||||
return nm + ":" + System.identityHashCode(this);
|
||||
|
@ -1274,9 +1276,11 @@ public abstract class AstTranslator extends CAstVisitor {
|
|||
vn = getUnderlyingSymtab().newSymbol();
|
||||
}
|
||||
if (useDefaultInitValues() && defaultInitValue != null) {
|
||||
if (getUnderlyingSymtab().getValue(vn) == null) {
|
||||
getUnderlyingSymtab().setDefaultValue(vn, defaultInitValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return nm + ":" + System.identityHashCode(this);
|
||||
|
@ -1319,8 +1323,10 @@ public abstract class AstTranslator extends CAstVisitor {
|
|||
protected Symbol makeSymbol(final String nm, boolean isFinal, final Object defaultInitValue, int vn, Scope definer) {
|
||||
final int v = vn == -1 ? getUnderlyingSymtab().newSymbol() : vn;
|
||||
if (useDefaultInitValues() && defaultInitValue != null) {
|
||||
if (getUnderlyingSymtab().getValue(v) == null) {
|
||||
getUnderlyingSymtab().setDefaultValue(v, defaultInitValue);
|
||||
}
|
||||
}
|
||||
return new AbstractSymbol(definer, isFinal, defaultInitValue) {
|
||||
public String toString() {
|
||||
return nm + ":" + System.identityHashCode(this);
|
||||
|
|
Loading…
Reference in New Issue