]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r258658:
authormdf <mdf@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Dec 2013 02:04:59 +0000 (02:04 +0000)
committermdf <mdf@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Dec 2013 02:04:59 +0000 (02:04 +0000)
commit20545ead38b6feaba0b753d3f0b6413da6586fb4
tree35e9d2622ed4eba155fa3d2c0443be29abef84ad
parent628e7b3ace082d501612dc9a76b65fae73f7ec65
MFC r258658:

Fix a segfault / internal compiler error.

Among other causes, when gcc throws a warning before parsing any tokens,
the cur_token pointer is at the beginning of malloc'd memory.
Dereferencing cur_token[-1] can cause a segfault.

Code taken from OpenBSD
http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/gcc/libcpp/errors.c
which was a more complete fix than the one I originally coded.

git-svn-id: svn://svn.freebsd.org/base/stable/9@259243 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/gcclibs/libcpp/errors.c