Fix -Wbitwise-instead-of-logical by splitting bitwise expression
Bug: http://b/215753485
This warning is found by new clang-r445002 update.
error: use of bitwise '&' with boolean operands
[-Werror,-Wbitwise-instead-of-logical]
mayFollow = (mayFollow | emitCatch()) & emitFinally();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&&
art/tools/jfuzz/jfuzz.cc:957:21: note: cast one or both operands to int
to silence this warning
Test: build with clang and verify absence of warning.
Change-Id: Ic908cf5b8076704d43c500abbcb65103bd16cd71
diff --git a/tools/jfuzz/jfuzz.cc b/tools/jfuzz/jfuzz.cc
index b8a646d..cda48f7 100644
--- a/tools/jfuzz/jfuzz.cc
+++ b/tools/jfuzz/jfuzz.cc
@@ -954,7 +954,8 @@
// finally block always follows after try and catch
// block. Code may only follow if the finally block permits
// and either the try or catch block allows code to follow.
- mayFollow = (mayFollow | emitCatch()) & emitFinally();
+ mayFollow = (mayFollow | emitCatch());
+ mayFollow &= emitFinally();
break;
}
fputc('\n', out_);