} else if (DOTYPECHECKS) {
writer.outputline("bool "+typevar.getSafeSymbol()+"=assertvalidtype(" + dest.getSafeSymbol() + ", " + this.td.getId() + ");");
}
- writer.outputline("if (!"+typevar.getSafeSymbol()+")");
- writer.startblock();
- writer.outputline(dest.getSafeSymbol()+"=0;");
- if (DONULL)
- writer.outputline(ptr + "(" + leftd.getSafeSymbol() + " + " + offset.getSafeSymbol() + ")=0;");
- writer.endblock();
+
+ if (DOTYPECHECKS||DOMEMCHECKS) {
+ writer.outputline("if (!"+typevar.getSafeSymbol()+")");
+ writer.startblock();
+ writer.outputline(dest.getSafeSymbol()+"=0;");
+ if (DONULL)
+ writer.outputline(ptr + "(" + leftd.getSafeSymbol() + " + " + offset.getSafeSymbol() + ")=0;");
+ writer.endblock();
+ }
+
writer.endblock();
}
writer.endblock();
boolean negate=dpred.isNegated();
VarDescriptor predvalue=VarDescriptor.makeNew("Predicatevalue");
p.generate(cr,predvalue);
+ if (k==0)
+ cr.outputline("int "+costvar.getSafeSymbol()+"=0;");
+
if (negate)
cr.outputline("if (maybe||"+predvalue.getSafeSymbol()+")");
else
cr.outputline("if (maybe||!"+predvalue.getSafeSymbol()+")");
- if (k==0)
- cr.outputline("int "+costvar.getSafeSymbol()+"="+cost.getCost(dpred)+";");
- else
- cr.outputline(costvar.getSafeSymbol()+"+="+cost.getCost(dpred)+";");
+ cr.outputline(costvar.getSafeSymbol()+"+="+cost.getCost(dpred)+";");
}
if(!first) {
SetDescriptor usedblock=(SetDescriptor)state.stSets.get("UsedBlock");
SetDescriptor usedinode=(SetDescriptor)state.stSets.get("UsedInode");
- if (usedblock.isSubset(sd))
+ if (usedblock!=null&&usedblock.isSubset(sd))
return true;
- if (usedinode.isSubset(sd))
+ if (usedinode!=null&&usedinode.isSubset(sd))
return true;
return false;
SetDescriptor usedblock=(SetDescriptor)state.stSets.get("UsedBlock");
SetDescriptor usedinode=(SetDescriptor)state.stSets.get("UsedInode");
- if (usedblock.isSubset(sd))
+ if (usedblock!=null&&usedblock.isSubset(sd))
return (SetDescriptor)state.stSets.get("FreeBlock");
- if (usedinode.isSubset(sd))
+ if (usedinode!=null&&usedinode.isSubset(sd))
return (SetDescriptor)state.stSets.get("FreeInode");
return null;