From a9621943087a5578c995d88b06f87c5158eb5d00 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 29 Mar 2009 09:45:37 +0000 Subject: Bug with overflow in line numbers git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1019 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cil.patch/clexer.mll.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cil.patch/clexer.mll.patch diff --git a/cil.patch/clexer.mll.patch b/cil.patch/clexer.mll.patch new file mode 100644 index 00000000..edbe8beb --- /dev/null +++ b/cil.patch/clexer.mll.patch @@ -0,0 +1,24 @@ +*** ../cil.orig/src/frontc/clexer.mll 2006-05-21 06:14:15.000000000 +0200 +--- ../cil/src/frontc/clexer.mll 2009-03-29 10:34:34.000000000 +0200 +*************** +*** 584,590 **** + | blank { hash lexbuf} + | intnum { (* We are seeing a line number. This is the number for the + * next line *) +! E.setCurrentLine (int_of_string (Lexing.lexeme lexbuf) - 1); + (* A file name must follow *) + file lexbuf } + | "line" { hash lexbuf } (* MSVC line number info *) +--- 584,595 ---- + | blank { hash lexbuf} + | intnum { (* We are seeing a line number. This is the number for the + * next line *) +! let s = Lexing.lexeme lexbuf in +! begin try +! E.setCurrentLine (int_of_string s - 1) +! with Failure _ -> +! E.warn "Bad line number in preprocessed file: %s" s +! end; + (* A file name must follow *) + file lexbuf } + | "line" { hash lexbuf } (* MSVC line number info *) -- cgit