https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88056

            Bug ID: 88056
           Summary: gcc/config/i386/host-mingw32.c:170: use of out of
                    scope pointer ?
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

trunk/gcc/config/i386/host-mingw32.c:166] ->
[trunk/gcc/config/i386/host-mingw32.c:162] ->
[trunk/gcc/config/i386/host-mingw32.c:170]: (error) Using pointer to local
variable 'local_object_name' that is out of scope.

Source code is

  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;
    }
  mmap_handle = CreateFileMappingA ((HANDLE) _get_osfhandle (fd), NULL,
                                    PAGE_WRITECOPY | SEC_COMMIT, 0, 0,
                                    object_name);

If the if ever triggers, object_name will be pointing at an out
of scope object.

Reply via email to