From 7af4ae721662724c44ca554b869795ff8623e86f Mon Sep 17 00:00:00 2001 From: dload0 <170800883+dload0@users.noreply.github.com> Date: Fri, 13 Jun 2025 15:58:12 +0100 Subject: [PATCH 1/2] fix: Make type visitor pass ArrayType on case. --- .../src/main/java/sootup/core/jimple/basic/LocalGenerator.java | 3 ++- .../java/sootup/core/jimple/visitor/AbstractTypeVisitor.java | 2 +- .../src/main/java/sootup/core/jimple/visitor/TypeVisitor.java | 2 +- sootup.core/src/main/java/sootup/core/types/ArrayType.java | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sootup.core/src/main/java/sootup/core/jimple/basic/LocalGenerator.java b/sootup.core/src/main/java/sootup/core/jimple/basic/LocalGenerator.java index dc7476dc216..aa7c3e5727f 100644 --- a/sootup.core/src/main/java/sootup/core/jimple/basic/LocalGenerator.java +++ b/sootup.core/src/main/java/sootup/core/jimple/basic/LocalGenerator.java @@ -30,6 +30,7 @@ import sootup.core.jimple.Jimple; import sootup.core.jimple.common.Local; import sootup.core.jimple.visitor.AbstractTypeVisitor; +import sootup.core.types.ArrayType; import sootup.core.types.ClassType; import sootup.core.types.Type; @@ -142,7 +143,7 @@ public void caseFloatType() { } @Override - public void caseArrayType() { + public void caseArrayType(@NonNull ArrayType arrayType) { result.append("r").append(tempRefLikeType++); } diff --git a/sootup.core/src/main/java/sootup/core/jimple/visitor/AbstractTypeVisitor.java b/sootup.core/src/main/java/sootup/core/jimple/visitor/AbstractTypeVisitor.java index 692f03aa32a..ad649cbc002 100644 --- a/sootup.core/src/main/java/sootup/core/jimple/visitor/AbstractTypeVisitor.java +++ b/sootup.core/src/main/java/sootup/core/jimple/visitor/AbstractTypeVisitor.java @@ -71,7 +71,7 @@ public void caseFloatType() { } @Override - public void caseArrayType() { + public void caseArrayType(@NonNull ArrayType arrayType) { defaultCaseType(); } diff --git a/sootup.core/src/main/java/sootup/core/jimple/visitor/TypeVisitor.java b/sootup.core/src/main/java/sootup/core/jimple/visitor/TypeVisitor.java index 92ecb0e00d7..db85f542398 100644 --- a/sootup.core/src/main/java/sootup/core/jimple/visitor/TypeVisitor.java +++ b/sootup.core/src/main/java/sootup/core/jimple/visitor/TypeVisitor.java @@ -43,7 +43,7 @@ public interface TypeVisitor extends Visitor { void caseFloatType(); - void caseArrayType(); + void caseArrayType(@NonNull ArrayType arrayType); void caseClassType(@NonNull ClassType classType); diff --git a/sootup.core/src/main/java/sootup/core/types/ArrayType.java b/sootup.core/src/main/java/sootup/core/types/ArrayType.java index 9382cb8621e..8f6a2fe96a3 100644 --- a/sootup.core/src/main/java/sootup/core/types/ArrayType.java +++ b/sootup.core/src/main/java/sootup/core/types/ArrayType.java @@ -98,7 +98,7 @@ public Type getElementType() { @Override public V accept(@NonNull V v) { - v.caseArrayType(); + v.caseArrayType(this); return v; } From ff553a5a94df74490972b085202838f4579830f7 Mon Sep 17 00:00:00 2001 From: "M.Schmidt" Date: Wed, 18 Jun 2025 15:42:31 +0200 Subject: [PATCH 2/2] fix license header leftover from dev --- .../java/sootup/core/jimple/JimpleIR.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sootup.core/src/main/java/sootup/core/jimple/JimpleIR.java b/sootup.core/src/main/java/sootup/core/jimple/JimpleIR.java index 75b2dd4797d..dd4b3bb6a8d 100644 --- a/sootup.core/src/main/java/sootup/core/jimple/JimpleIR.java +++ b/sootup.core/src/main/java/sootup/core/jimple/JimpleIR.java @@ -1,4 +1,26 @@ package sootup.core.jimple; +/*- + * #%L + * Soot - a J*va Optimization Framework + * %% + * Copyright (C) 2018-2026 Markus Schmidt + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 2.1 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * . + * #L% + */ + /** Marker interface to show whats considered Jimple IR */ public interface JimpleIR {}