From 5aaca752afa424015f81379dcd0a69e737340e56 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 14 Apr 2014 15:01:56 -0700 Subject: Fix 432714: stack map frame and generics --- tests/bugs180/pr432714/Code.java | 25 ++++++++++++++++++++++ .../org/aspectj/systemtest/ajc180/Ajc180Tests.java | 8 +++++++ tests/src/org/aspectj/systemtest/ajc180/ajc180.xml | 9 ++++++++ .../org/aspectj/weaver/bcel/asm/StackMapAdder.java | 3 +++ 4 files changed, 45 insertions(+) create mode 100644 tests/bugs180/pr432714/Code.java diff --git a/tests/bugs180/pr432714/Code.java b/tests/bugs180/pr432714/Code.java new file mode 100644 index 000000000..af871ab18 --- /dev/null +++ b/tests/bugs180/pr432714/Code.java @@ -0,0 +1,25 @@ +public class Code { + public static void main(String[]argv) { + } + + public void foo(UID x) { + bar((x instanceof UID ? E.one : E.two)); + } + + public static void bar(FM fm) { } +} + +aspect X { + void around(): execution(* foo(..)) { + } +} + +class E { + static BBB one; + static CCC two; + class BBB extends FM {} + class CCC extends FM {} +} +class FM {} + +class UID {} diff --git a/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java b/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java index 3da1f12b6..9a200fa9a 100644 --- a/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java @@ -20,6 +20,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase; * @author Andy Clement */ public class Ajc180Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + + public void testStackmapframe_431976() { + runTest("stackmapframe"); + } + + public void testStackOverflow_432608() { + runTest("stackoverflow"); + } public void testThisJoinPointNotInitialized_431976() { runTest("thisJoinPoint not initialized"); diff --git a/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml b/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml index 6f7b0c586..924ec89e5 100644 --- a/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml +++ b/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml @@ -2,6 +2,15 @@ + + + + + + + + + diff --git a/weaver/src/org/aspectj/weaver/bcel/asm/StackMapAdder.java b/weaver/src/org/aspectj/weaver/bcel/asm/StackMapAdder.java index 7f8c2ad3b..4624dda29 100644 --- a/weaver/src/org/aspectj/weaver/bcel/asm/StackMapAdder.java +++ b/weaver/src/org/aspectj/weaver/bcel/asm/StackMapAdder.java @@ -97,6 +97,9 @@ public class StackMapAdder { } else { do { resolvedType1 = resolvedType1.getSuperclass(); + if (resolvedType1.isParameterizedOrGenericType()) { + resolvedType1 = resolvedType1.getRawType(); + } } while (!resolvedType1.isAssignableFrom(resolvedType2)); return resolvedType1.getRawName().replace('.', '/'); } -- cgit v1.2.3