[PATCH] Fix segmentation fault when mixing -Rpass with #line.

Diego Novillo dnovillo at google.com
Thu May 8 06:44:53 PDT 2014


On Wed, May 7, 2014 at 5:32 PM, Richard Smith <richard at metafoo.co.uk> wrote:

> LGTM, although this makes the "do this properly" FIXME seem somewhat more
> of a pressing concern :)
>
>
Yeah. How depressing. I think I'll explore biting this particular bullet.
Maybe it's not as horrible as I think.


> ================
> Comment at: lib/CodeGen/CodeGenAction.cpp:405
> @@ -403,4 +404,3 @@
>          Column = 1;
> -      Loc = SourceMgr.translateFileLineCol(FileMgr.getFile(Filename),
> Line,
> -                                           Column);
> +      Loc = SourceMgr.translateFileLineCol(FE, Line, Column);
>      }
> ----------------
> How does `SourceMgr` respond if the file/line you give it is out of range
> for the file?
>

With a Loc that returns true for Loc.isInvalid(). In the test case I added,
the #line directive is completely bogus.


Diego.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140508/7c661c7b/attachment.html>


More information about the cfe-commits mailing list