diff options
author | acolyer <acolyer> | 2005-09-29 11:30:49 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-29 11:30:49 +0000 |
commit | d6256b8c3c944d8fa2feb6d837900144db6521ac (patch) | |
tree | 7159397e5b613f953c1faae0b1494314cb5bc6a4 /weaver | |
parent | c5171f738fcfa0cc947b2be45e00af8b78d7ac7d (diff) | |
download | aspectj-d6256b8c3c944d8fa2feb6d837900144db6521ac.tar.gz aspectj-d6256b8c3c944d8fa2feb6d837900144db6521ac.zip |
tests and fix for pr100195, local var debug info not preserved when inlining around advice
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/ShadowRange.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/ShadowRange.java b/weaver/src/org/aspectj/weaver/bcel/ShadowRange.java index 4deb8560d..b6381f9a7 100644 --- a/weaver/src/org/aspectj/weaver/bcel/ShadowRange.java +++ b/weaver/src/org/aspectj/weaver/bcel/ShadowRange.java @@ -127,8 +127,20 @@ final class ShadowRange extends Range { for (int j = sources.length - 1; j >= 0; j--) { InstructionTargeter source = sources[j]; if (source instanceof LocalVariableTag) { - // XXX destroying local variable info - source.updateTarget(oldIh, null); + Shadow.Kind kind = getKind(); + if (kind == Shadow.AdviceExecution || + kind == Shadow.ConstructorExecution || + kind == Shadow.MethodExecution || + kind == Shadow.PreInitialization || + kind == Shadow.Initialization || + kind == Shadow.StaticInitialization) { + // if we're extracting a whole block we can do this... + source.updateTarget(oldIh, freshIh); + } else { + // XXX destroying local variable info + // but only for a call or get join point, so no big deal + source.updateTarget(oldIh, null); + } } else if (source instanceof Range) { // exceptions and shadows are just moved ((Range)source).updateTarget(oldIh, freshIh, freshBody); |