> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision: - Update copyrights - Drop excess parentheses - Merge branch 'master' into JDK-8263434-dangling-methodcomparator-ecmp - Sprinkling consts - 8263434: Dangling references after MethodComparator::methods_EMCP ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/2937/files - new: https://git.openjdk.java.net/jdk/pull/2937/files/5acc4807..82bf43e0 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2937&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2937&range=01-02 Stats: 33632 lines in 1544 files changed: 24507 ins; 4957 del; 4168 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