------- Comment #5 from tromey at gcc dot gnu dot org  2007-01-17 18:39 -------
I read through the existing code here and I think it is subtly correct.

The default_compilers array has a final entry consisting of all zeroes:

  /* Mark end of table.  */
  {0, 0, 0, 0, 0}

'compilers' is initially a copy of this table.  So, the last entry in
compilers is all zeroes.

The code quoted in the PR is reallocating the compilers array.  It sets
some fields in the final entry -- but not all fields.  However, this is ok
since we know those to be zero.  Then this code memset()s the new
terminating entry to be all zeroes.  This lets us conclude that this
code is safe, by induction.

So, I am closing this PR as invalid.  If you believe this analysis is
in error, please reopen the PR and explain how.  I will provide a patch
in this case.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10961

Reply via email to