[Openmp-commits] [PATCH] D41171: Handle null pointer correctly in set_callback
Simon Convent via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Dec 13 04:54:55 PST 2017
sconvent created this revision.
sconvent added reviewers: protze.joachim, Hahnfeld, jlpeyton.
Handle null pointer correctly in set_callback
https://reviews.llvm.org/D41171
Files:
runtime/src/ompt-general.cpp
Index: runtime/src/ompt-general.cpp
===================================================================
--- runtime/src/ompt-general.cpp
+++ runtime/src/ompt-general.cpp
@@ -411,9 +411,15 @@
case event_name: \
if (ompt_event_implementation_status(event_name)) { \
ompt_callbacks.ompt_callback(event_name) = (callback_type)callback; \
- ompt_enabled.event_name = 1; \
+ if (callback) \
+ ompt_enabled.event_name = 1; \
+ else \
+ ompt_enabled.event_name = 0; \
} \
- return ompt_event_implementation_status(event_name);
+ if (callback) \
+ return ompt_event_implementation_status(event_name); \
+ else \
+ return ompt_set_always;
FOREACH_OMPT_EVENT(ompt_event_macro)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41171.126731.patch
Type: text/x-patch
Size: 1310 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20171213/496ab2ce/attachment.bin>
More information about the Openmp-commits
mailing list