RFR: 8308445: Linker should check that capture state segment is big enough
Jorn Vernee
jvernee at openjdk.org
Tue Jun 6 17:18:45 UTC 2023
On Tue, 6 Jun 2023 17:13:23 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Fix the bug mentioned in the JBS issue.
>>
>> The implementation is updated to slice the capture state segment using the capture state layout. This checks both that the segment is big enough, and that it is properly aligned.
>>
>> Additionally, I added a check for `MS::NULL` since this is also an illegal value we can catch early.
>>
>> Test cases are added for all three invalid values.
>>
>> Testing: `jdk_foreign` test suite.
>
> src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java line 114:
>
>> 112: MH_CHECK_SYMBOL = lookup.findStatic(SharedUtils.class, "checkSymbol",
>> 113: methodType(void.class, MemorySegment.class));
>> 114: MH_SLICE_CAPTURE_SEGMENT = lookup.findStatic(SharedUtils.class, "checkCaptureSegment",
>
> Is the name of the field correct?
That's a leftover from an earlier version, will fix
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14339#discussion_r1220031575
More information about the core-libs-dev
mailing list