Page MenuHomePhabricator

Fixed a crash on replaying Preamble's PP conditional stack.
ClosedPublic

Authored by ilya-biryukov on Aug 18 2017, 5:34 AM.

Details

Summary

The crash occurs when the first token after a preamble is a macro
expansion.
Fixed by moving replayPreambleConditionalStack from Parser into
Preprocessor. It is now called right after the predefines file is
processed.

Diff Detail

Repository
rL LLVM

Event Timeline

ilya-biryukov created this revision.Aug 18 2017, 5:34 AM
erikjv edited edge metadata.Aug 18 2017, 5:44 AM

Can you check if the example in https://bugs.llvm.org/show_bug.cgi?id=33574 works correctly?

include/clang/Lex/Preprocessor.h
2029 ↗(On Diff #111656)

Duplicate "private:"

ilya-biryukov marked an inline comment as done.Aug 18 2017, 8:33 AM

Can you check if the example in https://bugs.llvm.org/show_bug.cgi?id=33574 works correctly?

Works correctly, added an extra test for it.

bkramer accepted this revision.Aug 21 2017, 3:20 AM

This looks good to me.

This revision is now accepted and ready to land.Aug 21 2017, 3:20 AM
This revision was automatically updated to reflect the committed changes.
nik added a reviewer: hans.Aug 21 2017, 6:49 AM
nik added a subscriber: nik.

I see this in trunk/master submitted, but not in the release_50 branch. Could this be cherry-picked to 5.0?

hans edited edge metadata.Aug 21 2017, 1:00 PM
In D36872#847416, @nik wrote:

I see this in trunk/master submitted, but not in the release_50 branch. Could this be cherry-picked to 5.0?

I've replied on the commit message thread. Thanks!