[15] RFR(T) 8242357: [JVMCI] Incorrect use of JVMCI_CHECK_ on return statement

David Holmes david.holmes at oracle.com
Sat Apr 18 13:34:11 UTC 2020


Looks good!

Thanks,
David

On 18/04/2020 9:58 am, Vladimir Kozlov wrote:
> https://bugs.openjdk.java.net/browse/JDK-8242357
> 
> CHECK macros can't be used on a return statement - they expand to 
> include code after the return [2] and so have no affect.
> 
> Fix:
> 
> src/hotspot/share/jvmci/jvmciEnv.hpp
> @@ -262,7 +262,8 @@
>     char* as_utf8_string(JVMCIObject str, char* buf, int buflen);
> 
>     JVMCIObject create_string(Symbol* str, JVMCI_TRAPS) {
> -    return create_string(str->as_C_string(), JVMCI_CHECK_(JVMCIObject()));
> +    JVMCIObject s = create_string(str->as_C_string(), 
> JVMCI_CHECK_(JVMCIObject()));
> +    return s;
>     }
> 
> I tried to find similar cases but it was the only one.
> Clang -Wunreachable-code-aggressive does not catch this case.
> 
> Tested hs-tier1,hs-tier3-graal
> 
> Thanks,
> Vladimir
> 
> [1] 
> http://hg.openjdk.java.net/jdk/jdk/file/90882ba9f488/src/hotspot/share/jvmci/jvmciExceptions.hpp#l48 
> 


More information about the hotspot-compiler-dev mailing list