This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Fix invalid source range in co_await call expressions.
ClosedPublic

Authored by EricWF on Mar 26 2018, 6:54 PM.

Details

Summary

Currently an invalid source range is generated for the member call expressions of co_await. The end location of the call expression is the co_await token loc, while the start is the location of the operand. This causes crashes when the source range is used to produce diagnostics.

This patch fixes the issues by using the expression location instead of the token location when building the member calls.

Diff Detail

Event Timeline

EricWF created this revision.Mar 26 2018, 6:54 PM
vsk accepted this revision.Mar 26 2018, 8:14 PM

Thanks, LGTM.

This revision is now accepted and ready to land.Mar 26 2018, 8:14 PM
This revision was automatically updated to reflect the committed changes.

Excellent, thank you! I think this might fix PR34982?