aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/host-mingw32.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ca9ca7b..3d1a07a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2019-07-03 Martin Liska <mliska@suse.cz>
+ PR target/88056
+ * config/i386/host-mingw32.c (mingw32_gt_pch_use_address):
+ Define local_object_name in outer scope in order to handle
+ use-after-scope issue.
+
+2019-07-03 Martin Liska <mliska@suse.cz>
+
* common.opt: Add fprofile-note.
* coverage.c (coverage_init): Append the option
to bbg_file_name.
diff --git a/gcc/config/i386/host-mingw32.c b/gcc/config/i386/host-mingw32.c
index f2b56d7..3254d02 100644
--- a/gcc/config/i386/host-mingw32.c
+++ b/gcc/config/i386/host-mingw32.c
@@ -157,10 +157,10 @@ mingw32_gt_pch_use_address (void *addr, size_t size, int fd,
/* Determine the version of Windows we are running on and use a
uniquely-named local object if running > 4. */
GetVersionEx (&version_info);
+
+ char local_object_name[sizeof (OBJECT_NAME_FMT) + sizeof (DWORD) * 2];
if (version_info.dwMajorVersion > 4)
{
- char local_object_name [sizeof (OBJECT_NAME_FMT)
- + sizeof (DWORD) * 2];
snprintf (local_object_name, sizeof (local_object_name),
OBJECT_NAME_FMT "%lx", GetCurrentProcessId());
object_name = local_object_name;