RFR: 8267213: assert(left >= right) failed: avoid underflow [v2]

Jie Fu jiefu at openjdk.java.net
Mon May 17 07:54:47 UTC 2021


On Mon, 17 May 2021 06:45:45 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Hi Jie,
> 
> I'm not sure this is the right fix. It seems to me from the comments about having a sane addr and pc that the basic assumption/premise is that addr > pc as it is being checked when expected to be part of the current instruction. So if addr < pc I would think pc_is_near_addr should be false.
> 
> David

Thanks @dholmes-ora for your review.

Okay, I think your suggestion is good since it just works as before and won't make things worse.

But I'm not sure whether the basic assumption/premise that `addr > pc` is always right.

Let's consider the following case

...
    inst1
    inst2
    jmp L1  <--- sizeof(jmp) = 5 bytes, the first byte is on Page k, the other 4 bytes on Page k+1
    ...
L1:

In this case, I think `addr` would point to some part of the jmp instruction and `pc` would point to L1, which means addr < pc. 
What do you think?

Thanks.
Best regards,
Jie

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

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


More information about the hotspot-dev mailing list