RFR: 8304674: File java.c compile error with -fsanitize=address -O0

SendaoYan syan at openjdk.org
Mon Nov 25 06:21:52 UTC 2024


Hi all,
File `src/java.base/share/native/libjli/java.c` compile `error: control reaches end of non-void function [-Werror=return-type]` with gcc options `-fsanitize=address -O0`. The function `int JavaMain(void* _args)` in this file missed last return statement,  The original last macro statement `LEAVE();` in this fucntion do nothing since `do {...} while (JNI_FALSE)` is alway false and make no sense. This PR add final return statement make function complement, I think this change almost no risk.

Additional testing:

- [ ]   jtreg tests(include tier1/2/3 etc.) with linux-x64 release build
- [ ]   jtreg tests(include tier1/2/3 etc.) with linux-x64 fastdebug build
- [ ]   jtreg tests(include tier1/2/3 etc.) with linux-aarch64 release build
- [ ]   jtreg tests(include tier1/2/3 etc.) with linux-aarch64 fastdebug build

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

Commit messages:
 - 8304674: File java.c compile error with -fsanitize=address -O0

Changes: https://git.openjdk.org/jdk/pull/22355/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22355&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8304674
  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/22355.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22355/head:pull/22355

PR: https://git.openjdk.org/jdk/pull/22355


More information about the core-libs-dev mailing list