-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1146 from soot-oss/failed-jars-branch-20241014
Failed jars branch 20241014
- Loading branch information
Showing
4 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
....bytecode.frontend/src/test/java/sootup/java/bytecode/frontend/inputlocation/FixJars.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package sootup.java.bytecode.frontend.inputlocation; | ||
|
||
import categories.TestCategories; | ||
import java.nio.file.Paths; | ||
import java.util.Collections; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
import sootup.core.inputlocation.AnalysisInputLocation; | ||
import sootup.core.model.Body; | ||
import sootup.core.model.SourceType; | ||
import sootup.interceptors.NopEliminator; | ||
import sootup.jimple.frontend.JimpleAnalysisInputLocation; | ||
import sootup.jimple.frontend.JimpleView; | ||
|
||
@Tag(TestCategories.JAVA_8_CATEGORY) | ||
public class FixJars extends BaseFixJarsTest { | ||
|
||
@Test | ||
/* Isolated testcase from: | ||
* String jarDownloadUrl = "https://repo1.maven.org/maven2/io/github/adven27/exam-core/2024.0.10/exam-core-2024.0.10.jar"; | ||
* String methodSignature = "<io.github.adven27.concordion.extensions.exam.core.logger.LoggingFormatterExtension$LoggingFormatterListener: void afterExample(org.concordion.api.listener.ExampleEvent)>"; | ||
*/ | ||
public void executeexamcorejar() { | ||
AnalysisInputLocation inputLocation = | ||
new JimpleAnalysisInputLocation( | ||
Paths.get("./src/test/resources/"), | ||
SourceType.Application, | ||
Collections.singletonList(new NopEliminator())); | ||
JimpleView jimpleView = new JimpleView(inputLocation); | ||
jimpleView | ||
.getClasses() | ||
.forEach( | ||
sootClass -> { | ||
Body body = | ||
sootClass.getMethodsByName("nopEliminatorBug").stream() | ||
.findFirst() | ||
.get() | ||
.getBody(); | ||
}); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
sootup.java.bytecode.frontend/src/test/resources/nopEliminatorBugTest.jimple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
class DummyClass extends java.lang.Object { | ||
|
||
public int nopEliminatorBug() { | ||
this := @this: io.github.adven27.concordion.extensions.exam.core.logger.LoggingFormatterExtension$LoggingFormatterListener; | ||
event := @parameter0: org.concordion.api.listener.ExampleEvent; | ||
staticinvoke <kotlin.jvm.internal.Intrinsics: void checkNotNullParameter(java.lang.Object,java.lang.String)>(event, "event"); | ||
|
||
label1: | ||
nop; | ||
$stack5 = this.<io.github.adven27.concordion.extensions.exam.core.logger.LoggingFormatterExtension$LoggingFormatterListener: io.github.adven27.concordion.extensions.exam.core.logger.LoggingAdaptor loggingAdaptor>; | ||
it = interfaceinvoke $stack5.<io.github.adven27.concordion.extensions.exam.core.logger.LoggingAdaptor: java.io.File getLogFile()>(); | ||
$stack6 = virtualinvoke it.<java.io.File: boolean exists()>(); | ||
|
||
if $stack6 == 0 goto label2; | ||
specialinvoke this.<io.github.adven27.concordion.extensions.exam.core.logger.LoggingFormatterExtension$LoggingFormatterListener: void appendLogFileLinkToExample(org.concordion.api.listener.ExampleEvent,java.io.File)>(event, it); | ||
|
||
label2: | ||
nop; | ||
nop; | ||
|
||
label3: | ||
$stack7 = this.<io.github.adven27.concordion.extensions.exam.core.logger.LoggingFormatterExtension$LoggingFormatterListener: io.github.adven27.concordion.extensions.exam.core.logger.LoggingAdaptor loggingAdaptor>; | ||
interfaceinvoke $stack7.<io.github.adven27.concordion.extensions.exam.core.logger.LoggingAdaptor: void stopLogFile()>(); | ||
|
||
goto label6; | ||
|
||
label4: | ||
$stack8 := @caughtexception; | ||
l2 = $stack8; | ||
|
||
label5: | ||
$stack9 = this.<io.github.adven27.concordion.extensions.exam.core.logger.LoggingFormatterExtension$LoggingFormatterListener: io.github.adven27.concordion.extensions.exam.core.logger.LoggingAdaptor loggingAdaptor>; | ||
interfaceinvoke $stack9.<io.github.adven27.concordion.extensions.exam.core.logger.LoggingAdaptor: void stopLogFile()>(); | ||
|
||
throw l2; | ||
|
||
label6: | ||
return; | ||
|
||
catch java.lang.Throwable from label1 to label3 with label4; | ||
catch java.lang.Throwable from label4 to label5 with label4; | ||
} | ||
} |