RFR: 8262295: C2: Out-of-Bounds Array Load from Clone Source [v2]

Richard Reingruber rrich at openjdk.java.net
Thu Mar 18 09:59:42 UTC 2021


On Wed, 17 Mar 2021 16:43:30 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Richard Reingruber has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Changes based on feedback from Vladimir K.
>
> src/hotspot/share/opto/memnode.cpp line 536:
> 
>> 534:   ArrayCopyNode* ac = find_array_copy_clone(phase, ld_alloc, mem);
>> 535:   if (ac != NULL) {
>> 536:     Node* ld_addp = in(MemNode::Address);
> 
> I think you need to check (ld_addp->is_AddP()) as at line #560.

Ok, I've added the check.

> src/hotspot/share/opto/memnode.cpp line 541:
> 
>> 539:     const TypeAryPtr* ary_t = phase->type(src)->isa_aryptr();
>> 540: 
>> 541:     if (ary_t != NULL) {
> 
> Needs Comment explaining what code does.

Ok, I've added a few lines of comment. Let me know if you think something's still missing.

> test/hotspot/jtreg/compiler/arraycopy/TestOutOfBoundsArrayLoad.java line 39:
> 
>> 37:  * @build sun.hotspot.WhiteBox
>> 38:  * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
>> 39:  * @run main/othervm -XX:+UseSerialGC -Xmx128m
> 
> Add `* @requires vm.gc.Serial` to avoid conflict when testing env specifies different GC.

Done. Good you spotted this.

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

PR: https://git.openjdk.java.net/jdk/pull/2708


More information about the hotspot-compiler-dev mailing list