You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// `-CompoundStmt 0xa349148 <col:9, col:10>
int f() {
// vs the valid case
// `-CompoundStmt 0xa349148 <col:9, col:10>
int f() {}
Because of the error recovery, the source range of the compound stmt is the same for both cases. It is problematic for the broken case, as the location doesn't reflect the written source code -- the end-loc points to the end of file.
Fix options:
fix it in SelectionTree, by dropping the eof token in the ExpandedTokens if it presents
fix it in TokenBuffer::expandedTokens(SourceRange R) by not returning the eof token. This seems more aggressive. As this function is mainly used with a range provided by an AST node, this is probably ok (it might avoid the same issue in other clients?)
stack trace:
Looks like we're leaving an
eof
token in theExpandedTokens
, and it never gets removed (T.location() < Limit
doesn't meet)The text was updated successfully, but these errors were encountered: