RFR: Fix clang build warnings

Zhengyu Gu zgu at redhat.com
Thu Nov 1 15:03:41 UTC 2018


Looks good.

-Zhengyu

On 11/01/2018 10:50 AM, Aleksey Shipilev wrote:
> Even though C++ operator precedence rules make this right, clang still complains about mixing && and
> ||. This makes precedence explicit:
> 
> diff -r b6406cc37101 -r b03bb4c0d6e8 src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
> --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp  Tue Oct 30 17:17:00 2018 +0100
> +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp  Thu Nov 01 15:46:15 2018 +0100
> @@ -3169,7 +3169,7 @@
>     if (n == NULL ||
>         n->is_Allocate() ||
>         n->bottom_type() == TypePtr::NULL_PTR ||
> -      n->bottom_type()->make_oopptr() != NULL && n->bottom_type()->make_oopptr()->const_oop() !=
> NULL) {
> +      (n->bottom_type()->make_oopptr() != NULL && n->bottom_type()->make_oopptr()->const_oop() !=
> NULL)) {
>       return NotNeeded;
>     }
>     if (n->is_Phi() ||
> 
> Testing: Mac OS X builds
> 
> Thanks,
> -Aleksey
> 


More information about the shenandoah-dev mailing list