This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix a few use-after-free issues
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/21/11 11:50, Jakub Jelinek wrote:
> On Mon, Mar 21, 2011 at 11:37:16AM -0600, Jeff Law wrote:
>> Similarly for redirect_edge_succ_nodup in this fragment:
>>
>> ret = redirect_edge_succ_nodup (e, dest);
>> if (dump_file)
>> fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
>> e->src->index, e->dest->index, dest->index);
>> }
>> Luckily in this case the use-after-free only occurs when dumping, so it
>> won't typically affect end users.
>
> Well, the message is wrong anyway, becase e->dest->index will be
> dest->index (with the exception that e has been remove_edge, but then it is
> the use after free). Guess the message should be printed before the
> redirect_edge_succ_nodup call, or remember e->dest->index in some local
> variable and print that variable after the call.
Yea, I'll just move the message before the call to
redirecT_edge_succ_nodup.
jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNigLtAAoJEBRtltQi2kC7uDUH/ReumZW8xHR6cPVhSnVzoqn4
Ft0Ot84ADY/1n31Hw+b3T4XIEUNu3yr2PX8LCo+wbS8/fsWv6AEzSvAlJH3wgO06
RQOyf9+8fskDFCQWiGNXqJKdZXSUeFo4MwPfypjH699phx2QegarR+vEjhIlbUvu
qDOSwdh1K7YsRB670ktwwvzOmDgLXoyL4KW3V6SzNTlyII8/VvlML+izOF/kwxMG
WuiQCljCZCoUnAkrYfs4kyTTLnYKYr3734B1YxvI9KyIq4gEkMAXMSTYV+TZBz9Q
38xjBu5cPoZwN+cez8j1Uq4gXYhMsQ3aE5WNSVgQ+rkToYQUywpqRDH4Y8vjnTo=
=rCaO
-----END PGP SIGNATURE-----