summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pirama Arumuga Nainar <pirama@google.com> 2022-01-31 22:48:06 -0800
committer Pirama Arumuga Nainar <pirama@google.com> 2022-02-01 17:03:01 +0000
commit8ee882bf027def128c015f03bcf5b56cc74dd9fb (patch)
treee9b7c4d8141fff65b1cfcbc63b267348d79fd4ef
parent525c2b522c3825ab069dacfb6bad810362fce978 (diff)
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
-rw-r--r--tools/jfuzz/jfuzz.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/jfuzz/jfuzz.cc b/tools/jfuzz/jfuzz.cc
index b8a646d8fb..cda48f7207 100644
--- a/tools/jfuzz/jfuzz.cc
+++ b/tools/jfuzz/jfuzz.cc
@@ -954,7 +954,8 @@ class JFuzz {
// 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_);