diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-03-29 09:45:37 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-03-29 09:45:37 +0000 |
commit | a9621943087a5578c995d88b06f87c5158eb5d00 (patch) | |
tree | 70e1be60b1ad1bc47c675ea2ff327027ebdc62fb | |
parent | 3b8c7933be994a6e9864d6a6c7972a2e8014ad02 (diff) | |
download | compcert-a9621943087a5578c995d88b06f87c5158eb5d00.tar.gz compcert-a9621943087a5578c995d88b06f87c5158eb5d00.zip |
Bug with overflow in line numbers
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1019 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r-- | cil.patch/clexer.mll.patch | 24 |
1 files changed, 24 insertions, 0 deletions
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 *) |