[Openmp-commits] [openmp] 927c74d - [OpenMP] Fix assert macro expr
Joseph Huber via Openmp-commits
openmp-commits at lists.llvm.org
Fri Oct 29 14:44:34 PDT 2021
Author: Joseph Huber
Date: 2021-10-29T17:44:13-04:00
New Revision: 927c74d4dae5520ea83578261c1bd62eb1837d7d
URL: https://github.com/llvm/llvm-project/commit/927c74d4dae5520ea83578261c1bd62eb1837d7d
DIFF: https://github.com/llvm/llvm-project/commit/927c74d4dae5520ea83578261c1bd62eb1837d7d.diff
LOG: [OpenMP] Fix assert macro expr
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.
Added:
Modified:
openmp/libomptarget/DeviceRTL/include/Debug.h
Removed:
################################################################################
diff --git a/openmp/libomptarget/DeviceRTL/include/Debug.h b/openmp/libomptarget/DeviceRTL/include/Debug.h
index 4f3418766413..ee1b4857ac6a 100644
--- a/openmp/libomptarget/DeviceRTL/include/Debug.h
+++ b/openmp/libomptarget/DeviceRTL/include/Debug.h
@@ -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); \
More information about the Openmp-commits
mailing list