Integrated: 8263434: Dangling references after MethodComparator::methods_EMCP

Aleksey Shipilev shade at openjdk.java.net
Wed Mar 17 11:01:49 UTC 2021


On Thu, 11 Mar 2021 11:02:43 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> SonarCloud reports the following problem in MethodComparator::methods_EMCP:
>  "Address of stack memory associated with local variable 's_new' is still referred to by the global variable '_s_new' upon returning to the caller. This will be a dangling reference"
> 
> Code inspection reveals the assignment to static variables is only needed to pass them to helper methods. So, while this is not a detectable bug (yet), it is still cleaner not to expose stack variables in globals.
> 
> Additional testing:
>  - [x] Linux x86_64 fastdebug `tier1`
>  - [x] Linux x86_64 fastdebug, `vmTestbase_nsk_jvmti`

This pull request has now been integrated.

Changeset: f9f2eef9
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/f9f2eef9
Stats:     93 lines in 2 files changed: 4 ins; 7 del; 82 mod

8263434: Dangling references after MethodComparator::methods_EMCP

Reviewed-by: coleenp, sspitsyn

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

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


More information about the serviceability-dev mailing list