}
});
}
private Variable variable(int varIndex, Type type) {
Variable variable = slots.get(varIndex);
if (variable == null) {
LocalVariableInfo localVar = new LocalVariableInfo("local_" + varIndex, type);
slots.put(varIndex, localVar);
localVariables.add(localVar);
variable = localVar;
}
Type varType = variable.getType();
if (!varType.equals(type) && (type.isPrimitive() || varType.isPrimitive())) {
// Apparently the compiler reuses local variables and it is possible
// that the types change. So if types change we have to drop
// the variable and try again.
slots.put(varIndex, null);