aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-05-11 18:50:26 +0000
committerjhugunin <jhugunin>2003-05-11 18:50:26 +0000
commitd6123b025e87aa5033e420515cb61799b6d8ab27 (patch)
tree34762e3ea0efc5b5ce95b5ab254ea2eecc8f2d2f /weaver
parent1330fc6ce3e13ec7f816e651fd51a89bd31579ea (diff)
downloadaspectj-d6123b025e87aa5033e420515cb61799b6d8ab27.tar.gz
aspectj-d6123b025e87aa5033e420515cb61799b6d8ab27.zip
fix for Bugzilla Bug 37325
Weaver fails with NPE for very large source files
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java4
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/Utility.java15
2 files changed, 10 insertions, 9 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
index aa5c157ec..a5b5c06fb 100644
--- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
+++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
@@ -95,14 +95,14 @@ public final class LazyClassGen {
{
myGen = new ClassGen(class_name, super_class_name, file_name, access_flags, interfaces);
constantPoolGen = myGen.getConstantPool();
- fact = new InstructionFactory(constantPoolGen);
+ fact = new InstructionFactory(myGen, constantPoolGen);
}
//Non child type, so it comes from a real type in the world.
public LazyClassGen(BcelObjectType myType) {
myGen = new ClassGen(myType.getJavaClass());
constantPoolGen = myGen.getConstantPool();
- fact = new InstructionFactory(constantPoolGen);
+ fact = new InstructionFactory(myGen, constantPoolGen);
this.myType = myType;
Method[] methods = myGen.getMethods();
diff --git a/weaver/src/org/aspectj/weaver/bcel/Utility.java b/weaver/src/org/aspectj/weaver/bcel/Utility.java
index 402c85b2f..9dc9e2a90 100644
--- a/weaver/src/org/aspectj/weaver/bcel/Utility.java
+++ b/weaver/src/org/aspectj/weaver/bcel/Utility.java
@@ -27,6 +27,7 @@ import org.apache.bcel.generic.BranchInstruction;
import org.apache.bcel.generic.ConstantPushInstruction;
import org.apache.bcel.generic.INSTANCEOF;
import org.apache.bcel.generic.Instruction;
+import org.apache.bcel.generic.InstructionConstants;
import org.apache.bcel.generic.InstructionFactory;
import org.apache.bcel.generic.InstructionHandle;
import org.apache.bcel.generic.InstructionList;
@@ -318,13 +319,13 @@ public class Utility {
int i) {
Instruction inst;
switch(i) {
- case -1: inst = fact.ICONST_M1; break;
- case 0: inst = fact.ICONST_0; break;
- case 1: inst = fact.ICONST_1; break;
- case 2: inst = fact.ICONST_2; break;
- case 3: inst = fact.ICONST_3; break;
- case 4: inst = fact.ICONST_4; break;
- case 5: inst = fact.ICONST_5; break;
+ case -1: inst = InstructionConstants.ICONST_M1; break;
+ case 0: inst = InstructionConstants.ICONST_0; break;
+ case 1: inst = InstructionConstants.ICONST_1; break;
+ case 2: inst = InstructionConstants.ICONST_2; break;
+ case 3: inst = InstructionConstants.ICONST_3; break;
+ case 4: inst = InstructionConstants.ICONST_4; break;
+ case 5: inst = InstructionConstants.ICONST_5; break;
}
if (i <= Byte.MAX_VALUE && i >= Byte.MIN_VALUE) {
inst = new BIPUSH((byte)i);