fix special case in which primitive types could not be used as entrypoint parameters

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1099 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
dolby-oss 2007-05-11 15:16:39 +00:00
parent ed509d5910
commit aef9a11b3d
2 changed files with 10 additions and 2 deletions

View File

@ -99,8 +99,12 @@ public abstract class Entrypoint implements BytecodeConstants {
if (p.length == 0) {
return -1;
} else if (p.length == 1) {
SSANewInstruction n = m.addAllocation(p[0], warnings);
return (n == null) ? -1 : n.getDef();
if (p[0].isPrimitiveType()) {
return m.addLocal();
} else {
SSANewInstruction n = m.addAllocation(p[0], warnings);
return (n == null) ? -1 : n.getDef();
}
} else {
int[] values = new int[p.length];
int countErrors = 0;

View File

@ -95,6 +95,10 @@ public abstract class AbstractRootMethod extends SyntheticMethod {
return new SyntheticIR(this, Everywhere.EVERYWHERE, makeControlFlowGraph(), instrs, options, constants, warnings);
}
public int addLocal() {
return nextLocal++;
}
/**
* @return the invoke instructions added by this operation
* @throws IllegalArgumentException if site is null