diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2003-09-24 23:53:07 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2003-09-24 23:53:07 +0000 |
commit | e2e1fa50d933574f7711d9b4f6493381d68ae3fd (patch) | |
tree | 2f6029276812610822ac864fb806ed128477ad78 /gcc/cpplib.c | |
parent | d395df2636a4f74afbaa3b2d218b377326962d63 (diff) | |
download | gcc-e2e1fa50d933574f7711d9b4f6493381d68ae3fd.zip gcc-e2e1fa50d933574f7711d9b4f6493381d68ae3fd.tar.gz gcc-e2e1fa50d933574f7711d9b4f6493381d68ae3fd.tar.bz2 |
cpplib.c (do_pragma): Reintroduce cb_line_change call in the code path that calls a handler.
* cpplib.c (do_pragma): Reintroduce cb_line_change call in the
code path that calls a handler.
From-SVN: r71744
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 6a0f3e0..5a92755 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -1120,7 +1120,7 @@ static void do_pragma (cpp_reader *pfile) { const struct pragma_entry *p = NULL; - const cpp_token *token; + const cpp_token *token, *pragma_token = pfile->cur_token; unsigned int count = 1; pfile->state.prevent_expansion++; @@ -1141,7 +1141,17 @@ do_pragma (cpp_reader *pfile) } if (p) - p->u.handler (pfile); + { + /* Since the handler below doesn't get the line number, that it + might need for diagnostics, make sure it has the right + numbers in place. */ + if (pfile->cb.line_change) + (*pfile->cb.line_change) (pfile, pragma_token, false); + (*p->u.handler) (pfile); + if (pfile->cb.line_change) + (*pfile->cb.line_change) (pfile, pfile->cur_token, false); + + } else if (pfile->cb.def_pragma) { _cpp_backup_tokens (pfile, count); |