Message ID | 201012190838.35674.ebotcazou@adacore.com |
---|---|
State | New |
Headers | show |
>>>>> "Eric" == Eric Botcazou <ebotcazou@adacore.com> writes:
Eric> As explained in the audit trail, the patch doesn't work because
Eric> calls to _cpp_overlay_buffer and _cpp_remove_overlay are
Eric> unbalanced in the presence of #pragma redefine_extname, so the
Eric> attached hunk is also needed. In fact, it is even sufficient to
Eric> fix the problem, without the traditional.c hunk.
Eric> Tested on sparc64-sun-solaris2.9 and i586-suse-linux. OK for
Eric> mainline and 4.5/4.4 branches? If so, which version?
This is ok. I think it is fine to commit the version without the
traditional.c change.
Tom
On Tue, Jan 04, 2011 at 11:17:35AM -0700, Tom Tromey wrote: > >>>>> "Eric" == Eric Botcazou <ebotcazou@adacore.com> writes: > > Eric> As explained in the audit trail, the patch doesn't work because > Eric> calls to _cpp_overlay_buffer and _cpp_remove_overlay are > Eric> unbalanced in the presence of #pragma redefine_extname, so the > Eric> attached hunk is also needed. In fact, it is even sufficient to > Eric> fix the problem, without the traditional.c hunk. > > Eric> Tested on sparc64-sun-solaris2.9 and i586-suse-linux. OK for > Eric> mainline and 4.5/4.4 branches? If so, which version? > > This is ok. I think it is fine to commit the version without the > traditional.c change. Yeah, the traditional.c change was just a shot in the dark. Jakub
Index: directives.c =================================================================== --- directives.c (revision 167901) +++ directives.c (working copy) @@ -281,16 +281,17 @@ start_directive (cpp_reader *pfile) static void end_directive (cpp_reader *pfile, int skip_line) { - if (pfile->state.in_deferred_pragma) - ; - else if (CPP_OPTION (pfile, traditional)) + if (CPP_OPTION (pfile, traditional)) { /* Revert change of prepare_directive_trad. */ - pfile->state.prevent_expansion--; + if (!pfile->state.in_deferred_pragma) + pfile->state.prevent_expansion--; if (pfile->directive != &dtable[T_DEFINE]) _cpp_remove_overlay (pfile); } + else if (pfile->state.in_deferred_pragma) + ; /* We don't skip for an assembler #. */ else if (skip_line) { Index: traditional.c =================================================================== --- traditional.c (revision 167901) +++ traditional.c (working copy) @@ -1,5 +1,5 @@ /* CPP Library - traditional lexical analysis and macro expansion. - Copyright (C) 2002, 2004, 2005, 2007, 2008, 2009 + Copyright (C) 2002, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Neil Booth, May 2002 @@ -378,7 +378,8 @@ _cpp_scan_out_logical_line (cpp_reader * for (;;) { if (!context->prev - && cur >= pfile->buffer->notes[pfile->buffer->cur_note].pos) + && cur >= pfile->buffer->notes[pfile->buffer->cur_note].pos + && !pfile->overlaid_buffer) { pfile->buffer->cur = cur; _cpp_process_line_notes (pfile, false);