[OpenMP] Fix assert macro expr
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 29 Oct 2021 21:43:28 +0000 (17:43 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 29 Oct 2021 21:44:13 +0000 (17:44 -0400)
Summary:
A previous patch changed the check and mistakenly only did `!expr` when
this is a macro expansion and could only apply to the left side of an
expression.

openmp/libomptarget/DeviceRTL/include/Debug.h

index 4f34187..ee1b485 100644 (file)
@@ -25,7 +25,7 @@ void __assert_fail(const char *assertion, const char *file, unsigned line,
 
 #define ASSERT(expr)                                                           \
   {                                                                            \
-    if (config::isDebugMode(config::DebugKind::Assertion) && !expr)            \
+    if (config::isDebugMode(config::DebugKind::Assertion) && !(expr))          \
       __assert_fail(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__);           \
     else                                                                       \
       __assert_assume(expr);                                                   \