public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [og9] Fix uninitialised read in gomp_map_vars_internal
@ 2019-09-17 17:22 Julian Brown
  0 siblings, 0 replies; only message in thread
From: Julian Brown @ 2019-09-17 17:22 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andrew Stubbs, Thomas Schwinge

This patch fixes a stray read of uninitialised data in
target.c:gomp_map_vars_internal that I noticed when running an unrelated
test under valgrind.

I will apply to the openacc-gcc-9-branch shortly.

Julian

ChangeLog

	libgomp/
	* target.c (gomp_map_vars_internal): Remove read of uninitialised
	data.
---
 libgomp/ChangeLog.openacc | 5 +++++
 libgomp/target.c          | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc
index 1a624af1ff9..41e05e9c61b 100644
--- a/libgomp/ChangeLog.openacc
+++ b/libgomp/ChangeLog.openacc
@@ -1,3 +1,8 @@
+2019-09-17  Julian Brown  <julian@codesourcery.com>
+
+	* target.c (gomp_map_vars_internal): Remove read of uninitialised
+	data.
+
 2019-09-17  Julian Brown  <julian@codesourcery.com>
 
 	* testsuite/libgomp.oacc-c-c++-common/async_queue-1.c: Only run
diff --git a/libgomp/target.c b/libgomp/target.c
index 5f7f946e2ba..0656df19613 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -1556,8 +1556,7 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep,
 				      kind & typemask, cbufp);
 	    else
 	      {
-		if (k->virtual_refcount == VREFCOUNT_LINK_KEY)
-		  k->u.link_key = NULL;
+		k->u.link_key = NULL;
 		if (n && n->refcount == REFCOUNT_LINK)
 		  {
 		    /* Replace target address of the pointer with target address
-- 
2.22.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-17 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 17:22 [PATCH] [og9] Fix uninitialised read in gomp_map_vars_internal Julian Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).