[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-compiler-dev
Subject:    Integrated: 8236490: Compiler bug relating to @NonNull annotation
From:       Guoxiong Li <github.com+13688759+lgxbslgx () openjdk ! java ! net>
Date:       2021-01-26 9:00:45
Message-ID: EQZZXFtzeydW49mz0mTGLE1al1E59BeuyT6lt5RmJq0=.52e6f929-8862-4815-a23b-56356a71c68e () github ! com
[Download RAW message or body]

On Wed, 13 Jan 2021 10:01:26 GMT, Guoxiong Li \
<github.com+13688759+lgxbslgx@openjdk.org> wrote:

> Hi all,
> 
> If the exception class index in constant pool exceeds 256, the `exception_index` in \
> `TypeAnnotationPosition` will not work as expected. Please see the following code: 
> public void setCatchInfo(final int catchType, final int startPos) {
> Assert.check(!hasExceptionIndex(),
> "exception_index is already set");
> Assert.check(catchType >= 0, "Expected a valid catch type");
> this.exception_index = -((catchType | startPos << 8) + 1);  // \
> <------------------------------ }
> 
> If `catchType` > 256, which means the 8-15 bits is useful, the ` -((catchType | \
> startPos << 8) + 1);` would override these bits. 
> This patch separates the `startPos` into a new field `exceptionStartPos` to solve \
> the bug. And a test case is added. 
> Thank you for taking the time to review.
> 
> Best Regards.

This pull request has now been integrated.

Changeset: 23edb6f6
Author:    Guoxiong Li <lgxbslgx@gmail.com>
Committer: Joel Borggrén-Franck <jfranck@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/23edb6f6
Stats:     117 lines in 2 files changed: 111 ins; 0 del; 6 mod

8236490: Compiler bug relating to @NonNull annotation

Reviewed-by: vromero, jfranck

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic