From 2b0e11d8633c84e8b0827e0eb77b4639fe0914e4 Mon Sep 17 00:00:00 2001 From: Andrew Clement Date: Tue, 15 Apr 2025 15:26:29 -0700 Subject: Fix more "Attempt to push null on operand stack" variants This change fixes more cases in the *Declaration classes that generate code. Both #336 and #337 are due to the same piece of code not correctly computing the resolved position because of copying it from a source method when it needs recomputing for the method being generated. In particular primitive types and/or double slot types (like long or double) cause the code to miscompute the resolved positions or set the wrong type of expected type on the stack. Fixes #336 Fixes #337 --- .../test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java | 8 ++++++++ .../aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/src/test/java/org/aspectj/systemtest/ajc1924') diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java index e186993b2..aeb283c02 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java @@ -21,6 +21,14 @@ public class Bugs1924Tests extends XMLBasedAjcTestCase { public void testNothing() { } + + public void testGh336_ProceedCodeGenProblem() { + runTest("proceed code gen problem 1"); + } + + public void testGh337_ProceedCodeGenProblem() { + runTest("proceed code gen problem 2"); + } @Override protected java.net.URL getSpecFile() { diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java index 3e95d587e..1143e604c 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java @@ -25,9 +25,7 @@ public class Java24PreviewFeaturesTests extends JavaVersionSpecificXMLBasedAjcTe return XMLBasedAjcTestCase.loadSuite(Java24PreviewFeaturesTests.class); } - public void testJep455PrimitivePatternsSwitch1() { - fail(); -// runTest("primitive types patterns - switch"); + public void testNothing() { } @Override -- cgit v1.2.3