]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r258658:
authormdf <mdf@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Dec 2013 02:03:42 +0000 (02:03 +0000)
committermdf <mdf@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Dec 2013 02:03:42 +0000 (02:03 +0000)
commit92f7bf73b05bc6806eb84dd95bcbffb4621025b1
tree3d3918b92257dc5eec9879c2c364c02650724896
parenta12ff91b60be4dff0de2c41116516719b78caaec
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/10@259242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/gcclibs/libcpp/errors.c