Skip to content

Fix/type visitor array case #1327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions sootup.core/src/main/java/sootup/core/jimple/JimpleIR.java
Original file line number Diff line number Diff line change
@@ -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
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/

/** Marker interface to show whats considered Jimple IR */
public interface JimpleIR {}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -142,7 +143,7 @@ public void caseFloatType() {
}

@Override
public void caseArrayType() {
public void caseArrayType(@NonNull ArrayType arrayType) {
result.append("r").append(tempRefLikeType++);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void caseFloatType() {
}

@Override
public void caseArrayType() {
public void caseArrayType(@NonNull ArrayType arrayType) {
defaultCaseType();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface TypeVisitor extends Visitor {

void caseFloatType();

void caseArrayType();
void caseArrayType(@NonNull ArrayType arrayType);

void caseClassType(@NonNull ClassType classType);

Expand Down
2 changes: 1 addition & 1 deletion sootup.core/src/main/java/sootup/core/types/ArrayType.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Type getElementType() {

@Override
public <V extends TypeVisitor> V accept(@NonNull V v) {
v.caseArrayType();
v.caseArrayType(this);
return v;
}

Expand Down