This is an archive of the discontinued LLVM Phabricator instance.

[Format] Do not use a global static value for EOF within ScopedMacroState.
ClosedPublic

Authored by dlj on Jun 4 2018, 8:42 PM.

Details

Summary

ScopedMacroState injects its own EOF token under certain conditions, and the
returned token may be modified in several different locations. If multiple
reformat operations are started in different threads, then they will both see
the same fake EOF token, and may both try to modify it. This is a data race.

This bug was caught with tsan.

Diff Detail

Event Timeline

dlj created this revision.Jun 4 2018, 8:42 PM
djasper edited reviewers, added: klimek; removed: djasper.Jun 5 2018, 4:25 AM
This revision is now accepted and ready to land.Jun 14 2018, 9:04 PM
This revision was automatically updated to reflect the committed changes.