public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-2559] libgomp: Fix up OMP_PROC_BIND handling [PR106894]
Date: Fri,  9 Sep 2022 11:47:22 +0000 (GMT)	[thread overview]
Message-ID: <20220909114722.994B6385116E@sourceware.org> (raw)

https://gcc.gnu.org/g:26a1f4fcb264d110708483815c8c8d7bb4ff6788

commit r13-2559-g26a1f4fcb264d110708483815c8c8d7bb4ff6788
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Sep 9 13:43:43 2022 +0200

    libgomp: Fix up OMP_PROC_BIND handling [PR106894]
    
    While the first param is char (gomp_global_icv.bind_var), the second param
    is char * (gomp_bind_var_list), so we shouldn't access it through *(char *).
    
    2022-09-09  Jakub Jelinek  <jakub@redhat.com>
    
            PR libgomp/106894
            * env.c (initialize_env) <case PARSE_BIND>: Use char ** instead of
            char * for dest[1] initialization from params[1].  Formatting fixes.

Diff:
---
 libgomp/env.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libgomp/env.c b/libgomp/env.c
index 82e22ac789f..92f32f72020 100644
--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -2184,12 +2184,10 @@ initialize_env (void)
 	    *(int *) (host_envvars[omp_var].dest[1]) = *(int *) params[1];
 	    break;
 	  case PARSE_BIND:
-	    *(char *) (host_envvars[omp_var].dest[0])
-		  = *(char *) params[0];
-	    *(char *) (host_envvars[omp_var].dest[1])
-		  = *(char *) params[1];
+	    *(char *) (host_envvars[omp_var].dest[0]) = *(char *) params[0];
+	    *(char **) (host_envvars[omp_var].dest[1]) = *(char **) params[1];
 	    *(unsigned long *) (host_envvars[omp_var].dest[2])
-		  = *(unsigned long *) params[2];
+	      = *(unsigned long *) params[2];
 	    break;
 	  }
       }

                 reply	other threads:[~2022-09-09 11:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220909114722.994B6385116E@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).