This is an archive of the discontinued LLVM Phabricator instance.

Lex: Don't lex after getting EOF when handling _Pragma
ClosedPublic

Authored by majnemer on Aug 14 2014, 1:49 PM.

Details

Reviewers
majnemer
rsmith
Summary

The error recovery path in _Pragma attempted to lex past the non-string
literal token and then lex past a closing right paren if it exists.

However, this path wasn't careful in the face of EOF.

This fixes PR20662.

Diff Detail

Event Timeline

majnemer updated this revision to Diff 12525.Aug 14 2014, 1:49 PM
majnemer retitled this revision from to Lex: Don't lex after getting EOF when handling _Pragma.
majnemer updated this object.
majnemer added a reviewer: rsmith.
majnemer added a subscriber: Unknown Object (MLST).
rsmith added inline comments.Aug 14 2014, 2:50 PM
lib/Lex/Pragma.cpp
196

I think you should also stop at EOD and EOM (that is, tok::eod and tok::annot_module_*).

rnk added a subscriber: rnk.Aug 14 2014, 3:09 PM

I landed a change like this in r215672, but I don't have mail for it yet... Not sure what's up.

majnemer accepted this revision.Aug 14 2014, 5:27 PM
majnemer added a reviewer: majnemer.

Superseded by rL215672.

This revision is now accepted and ready to land.Aug 14 2014, 5:27 PM