Browse files

do not generate state for undefined variables

  • Loading branch information...
1 parent 182a3a4 commit cf2c3749d0a174fe607a7a37ceb71e040e17e591 @krestenkrab committed Dec 21, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/kilim/analysis/CallWeaver.java
View
8 src/kilim/analysis/CallWeaver.java
@@ -227,7 +227,8 @@ private void assignRegisters() {
for (; i < f.getMaxLocals(); i++) {
Value v = f.getLocal(i);
if (u.isLiveIn(i)) {
- if (!(v.isConstant() || valInfoList.contains(v))) {
+ if (!(v.isConstant() || valInfoList.contains(v))
+ && v.getTypeDesc() != D_UNDEFINED) {
ValInfo vi = new ValInfo(v);
vi.var = i;
valInfoList.add(vi);
@@ -941,7 +942,7 @@ BasicBlock getBasicBlock() {
/**
* The type of value boiled down to one of the canonical types.
*/
- int vmt;
+ final int vmt;
/**
* Names of the fields in the state var: "f0", "f1", etc, according to their
@@ -952,6 +953,9 @@ BasicBlock getBasicBlock() {
ValInfo(Value v) {
val = v;
vmt = VMType.toVmType(v.getTypeDesc());
+
+ if (vmt < 0 || vmt > 4)
+ throw new InternalError();
}
String fieldDesc() {

0 comments on commit cf2c374

Please sign in to comment.