Fold assert-used variable into assert
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 1 Aug 2022 21:56:05 +0000 (21:56 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 1 Aug 2022 21:57:11 +0000 (21:57 +0000)
Fixes #56724

bolt/lib/Core/BinaryContext.cpp

index 9331643..ae804ac 100644 (file)
@@ -778,9 +778,8 @@ BinaryContext::getOrCreateJumpTable(BinaryFunction &Function, uint64_t Address,
     // Prevent associating a jump table to a specific fragment twice.
     // This simple check arises from the assumption: no more than 2 fragments.
     if (JT->Parents.size() == 1 && JT->Parents[0] != &Function) {
-      bool SameFunction = isFragmentOf(JT->Parents[0], &Function) ||
-                          isFragmentOf(&Function, JT->Parents[0]);
-      assert(SameFunction &&
+      assert((isFragmentOf(JT->Parents[0], &Function) ||
+              isFragmentOf(&Function, JT->Parents[0])) &&
              "cannot re-use jump table of a different function");
       // Duplicate the entry for the parent function for easy access
       JT->Parents.push_back(&Function);