8225783: Incorrect use of binary operators on booleans in type.cpp
Summary: Use logical operators instead.
Reviewed-by: roland
--- a/src/hotspot/share/opto/type.cpp Fri Jun 14 10:19:04 2019 +0530
+++ b/src/hotspot/share/opto/type.cpp Fri Jun 14 13:26:52 2019 +0200
@@ -2109,7 +2109,7 @@
const TypeAry *a = t->is_ary();
return TypeAry::make(_elem->meet_speculative(a->_elem),
_size->xmeet(a->_size)->is_int(),
- _stable & a->_stable);
+ _stable && a->_stable);
}
case Top:
break;
@@ -3879,7 +3879,7 @@
bool subtype_exact = false;
if( tinst_klass->equals(this_klass) ) {
subtype = this_klass;
- subtype_exact = below_centerline(ptr) ? (this_xk & tinst_xk) : (this_xk | tinst_xk);
+ subtype_exact = below_centerline(ptr) ? (this_xk && tinst_xk) : (this_xk || tinst_xk);
} else if( !tinst_xk && this_klass->is_subtype_of( tinst_klass ) ) {
subtype = this_klass; // Pick subtyping class
subtype_exact = this_xk;
@@ -4361,7 +4361,7 @@
if (below_centerline(this->_ptr)) {
xk = this->_klass_is_exact;
} else {
- xk = (tap->_klass_is_exact | this->_klass_is_exact);
+ xk = (tap->_klass_is_exact || this->_klass_is_exact);
}
return make(ptr, const_oop(), tary, lazy_klass, xk, off, instance_id, speculative, depth);
case Constant: {