gcc/libcpp
Dodji Seketeli 3ad64f53da Properly initialize cpp_context in destringize_and_run
destringize_and_run forgets to initialize all the fields of the
cpp_context that it pushes.  Later _cpp_pop_context then gets confused
when it accesses context->tokens_kind via the call to macro_of_context
on context->prev.

The first hunk of this patch is the real obvious fix.  The second hunk
is just an assert that I am adding to err on the safe side.

Tested by on x86_64-unknown-linux-gnu against trunk by running the
test gcc.dg/gomp/macro-4.c under Valgrind, and bootstrapped.

libcpp/

	* directives.c (destringize_and_run): Properly initialize the new
	context.
	* macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
	the initial base context, which has the same life time as the
	current instance of cpp_file.

From-SVN: r187054
2012-05-02 18:55:19 +02:00
..
include Strip "<built-in>" loc from displayed expansion context 2012-04-30 13:42:12 +02:00
po * vi.po: Update. 2012-04-24 23:16:24 +01:00
ChangeLog Properly initialize cpp_context in destringize_and_run 2012-05-02 18:55:19 +02:00
Makefile.in re PR bootstrap/50857 (The compiler is built with exceptions and RTTI enabled) 2011-11-03 17:17:07 +00:00
aclocal.m4 Undo inadvertent commit in rev 160105. 2010-06-01 10:20:24 -04:00
charset.c Update Copyright years for files modified in 2010. 2011-01-03 21:52:22 +01:00
config.in re PR bootstrap/45538 (--enable-build-with-cxx compiling gcc/libcpp/charset.c) 2010-11-18 07:35:34 +00:00
configure Add ports for TILE-Gx and TILEPro. 2012-02-14 10:02:21 +00:00
configure.ac Add ports for TILE-Gx and TILEPro. 2012-02-14 10:02:21 +00:00
directives-only.c LINEMAP_POSITION_FOR_COLUMN had the exact same effect as linemap_position_for_column... 2011-08-15 20:35:58 +00:00
directives.c Properly initialize cpp_context in destringize_and_run 2012-05-02 18:55:19 +02:00
errors.c Update Copyright years for files modified in 2010. 2011-01-03 21:52:22 +01:00
expr.c re PR c++/50958 ([C++0x] raw literal operator provides incorrect string for integer literal '0') 2011-11-21 14:27:30 -05:00
files.c re PR c++/52974 (Canonicalize include paths in diagnostics) 2012-04-30 16:57:22 +00:00
identifiers.c Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. 2009-04-09 17:00:19 +02:00
init.c Switch -ftrack-macro-expansion=2 on by default. 2012-04-30 13:43:43 +02:00
internal.h re PR preprocessor/33919 (__BASE_FILE__ does not expand correctly when included from the command line) 2012-01-09 08:48:43 +00:00
lex.c Don't use C++ style comments in libcpp 2012-04-29 18:27:08 +02:00
line-map.c Strip "<built-in>" loc from displayed expansion context 2012-04-30 13:42:12 +02:00
macro.c Properly initialize cpp_context in destringize_and_run 2012-05-02 18:55:19 +02:00
makeucnid.c Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. 2009-04-09 17:00:19 +02:00
mkdeps.c files.c (file_hash_eq): Use filename_cmp instead of strcmp. 2011-03-25 20:11:26 +01:00
pch.c remove useless if-before-free tests 2011-04-20 18:19:03 +00:00
symtab.c directives.c (do_linemarker, do_line): Use CPP_STRING for ignored enum value. 2009-07-18 03:22:16 +00:00
system.h system.h: Prior to #define, #undef fopen and freopen unconditionally. 2012-01-03 11:44:34 +00:00
traditional.c Generate virtual locations for tokens 2011-10-17 11:59:12 +02:00
ucnid.h Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. 2009-04-09 17:00:19 +02:00
ucnid.tab Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. 2009-04-09 17:00:19 +02:00