This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix StreamErrorState hash bug
ClosedPublic

Authored by steakhal on Jun 15 2022, 2:33 AM.

Details

Summary

The Profile function was incorrectly implemented.
The StreamErrorState has an implicit bool conversion operator, which
will result in a different hash than faithfully hashing the raw value of
the enum.

I don't have a test for it, since it seems difficult to find one.
Even if we would have one, any change in the hashing algorithm would
have a chance of breaking it, so I don't think it would justify the
effort.

Depends on D127836, which uncovered this issue by marking the related
Profile function dead.

Diff Detail

Event Timeline

steakhal created this revision.Jun 15 2022, 2:33 AM
Herald added a project: Restricted Project. · View Herald Transcript
steakhal requested review of this revision.Jun 15 2022, 2:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 2:33 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
martong accepted this revision.Jun 15 2022, 4:39 AM

Nice catch! LGTM

This revision is now accepted and ready to land.Jun 15 2022, 4:39 AM
balazske accepted this revision.Jun 15 2022, 5:48 AM

This change introduces a single new report:

This makes me believe that this bug was not that important after all.

This revision was landed with ongoing or failed builds.Jun 15 2022, 7:50 AM
This revision was automatically updated to reflect the committed changes.