RFR: 8362306: HotSpotJVMCIRuntime.getMirror can crash [v2]

Gilles Duboscq gdub at openjdk.org
Wed Jul 16 10:27:40 UTC 2025


On Wed, 16 Jul 2025 08:48:53 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> This PR fixes `HotSpotJVMCIRuntime.getMirror(ResolvedJavaMethod method)` and `HotSpotJVMCIRuntime.getMirror(ResolvedJavaField field)` so that they return null for `<clinit>` and an injected field respectively instead of crashing.
>
> Doug Simon has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   fixed bug in HotSpotJVMCIRuntime.getMirror for <clinit> and injected fields

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp line 3000:

> 2998: }
> 2999: 
> 3000: C2V_VMENTRY_NULL(jobject, asReflectionField, (JNIEnv* env, jobject, ARGUMENT_PAIR(klass), jint index))

There is the same pattern in `getEncodedFieldAnnotationData`, we should probably defend there as well.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26346#discussion_r2209921506


More information about the graal-dev mailing list