Page MenuHomePhabricator

[analyzer] do not crash with assertion on processing locations of bodyfarmed functions
ClosedPublic

Authored by george.karpenkov on Jan 2 2018, 1:38 PM.

Details

Summary

This addresses an issue introduced in r183451: since removePiecesWithInvalidLocations is called *after* adjustCallLocations, it is not necessary, and in fact harmful, to have this assertion in adjustCallLocations.

Addresses rdar://36170689

Diff Detail

Repository
rC Clang

Event Timeline

The error is triggered when analyzer finds a bug *inside* the callable captured by the body farm.
Probably we didn't see the crash in the wild because either
a) the clang build did not have assertions enabled
or
b) the HTML output was not enabled

and the bug needs both to trigger.
In any case it does not make sense to assert that invalid locations are not present on the path if right after we are calling a subroutine which removes all diagnostics which do have invalid locations.

NoQ accepted this revision.Jan 2 2018, 2:27 PM

Yep, so it still doesn't answer if removePiecesWithInvalidLocations() was dead code to begin with (considering that the assertion in adjustCallLocations() says that everything but call locations is valid by now, and call locations are fixed immediately after that). The piece with invalid location seems to be a control flow piece (grey piece / arrow) which is indeed not to be displayed to the user in this case. I'm still not sure how/if-at-all this worked before. But the new behavior looks correct and i don't see these questions as the most pressing issues we're having at the moment :)

This revision is now accepted and ready to land.Jan 2 2018, 2:27 PM
This revision was automatically updated to reflect the committed changes.