[Openmp-commits] [PATCH] D112806: [OpenMP][OMPT] Add two missing nullpointer checks in ompt-multiplex.h

Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 7 05:01:52 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG94ec99752112: [OpenMP][OMPT] Add two missing nullpointer checks in ompt-multiplex.h (authored by Joachim Jenke <jenke at itc.rwth-aachen.de>).
Herald added subscribers: wangpc, jplehr, sunshaoce.
Herald added a project: All.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112806/new/

https://reviews.llvm.org/D112806

Files:
  openmp/tools/multiplex/ompt-multiplex.h


Index: openmp/tools/multiplex/ompt-multiplex.h
===================================================================
--- openmp/tools/multiplex/ompt-multiplex.h
+++ openmp/tools/multiplex/ompt-multiplex.h
@@ -142,6 +142,8 @@
 static ompt_data_t *ompt_multiplex_get_own_ompt_data(ompt_data_t *data) {
   if (!data)
     return NULL;
+  if (!data->ptr)
+    return NULL;
   ompt_multiplex_data_pair_t *data_pair =
       (ompt_multiplex_data_pair_t *)data->ptr;
   return &(data_pair->own_data);
@@ -150,6 +152,8 @@
 static ompt_data_t *ompt_multiplex_get_client_ompt_data(ompt_data_t *data) {
   if (!data)
     return NULL;
+  if (!data->ptr)
+    return NULL;
   ompt_multiplex_data_pair_t *data_pair =
       (ompt_multiplex_data_pair_t *)data->ptr;
   return &(data_pair->client_data);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112806.538092.patch
Type: text/x-patch
Size: 787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230707/cc7ab8ca/attachment.bin>


More information about the Openmp-commits mailing list