Skip to content

Commit 82be5fb

Browse files
committed
[GR-37091] Ensure NativeImageDebugLineInfo#ownerType returns the unwrapped type.
PullRequest: graal/11154
2 parents b56f39c + 716b91c commit 82be5fb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageDebugInfoProvider.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -37,6 +37,7 @@
3737
import java.util.function.Consumer;
3838
import java.util.stream.Stream;
3939

40+
import com.oracle.graal.pointsto.infrastructure.WrappedJavaType;
4041
import jdk.vm.ci.meta.JavaType;
4142
import org.graalvm.compiler.code.CompilationResult;
4243
import org.graalvm.compiler.code.SourceMapping;
@@ -1061,10 +1062,16 @@ public Path cachePath() {
10611062

10621063
@Override
10631064
public ResolvedJavaType ownerType() {
1065+
ResolvedJavaType result;
10641066
if (method instanceof HostedMethod) {
1065-
return getDeclaringClass((HostedMethod) method, true);
1067+
result = getDeclaringClass((HostedMethod) method, true);
1068+
} else {
1069+
result = method.getDeclaringClass();
1070+
}
1071+
if (result instanceof WrappedJavaType) {
1072+
result = ((WrappedJavaType) result).getWrapped();
10661073
}
1067-
return method.getDeclaringClass();
1074+
return result;
10681075
}
10691076

10701077
@Override

0 commit comments

Comments
 (0)