RFR: 8263434: Dangling references after MethodComparator::methods_EMCP [v2]
Aleksey Shipilev
shade at openjdk.java.net
Thu Mar 11 13:50:24 UTC 2021
> 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`
Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
Sprinkling consts
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/2937/files
- new: https://git.openjdk.java.net/jdk/pull/2937/files/9a43dca1..5acc4807
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2937&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2937&range=00-01
Stats: 13 lines in 2 files changed: 3 ins; 0 del; 10 mod
Patch: https://git.openjdk.java.net/jdk/pull/2937.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2937/head:pull/2937
PR: https://git.openjdk.java.net/jdk/pull/2937
More information about the hotspot-dev
mailing list