This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Fix 2 bugs in `MemberExpr` interpretation.
ClosedPublic

Authored by ymandel on Jan 10 2023, 6:59 AM.

Details

Summary

There were two (small) bugs causing crashes in the analysis. This patch fixes both of them.

  1. An enum value was accessed as a class member. Now, the engine gracefully ignores such member expressions.
  1. Field access in MemberExpr of struct/class-typed global variables. Analysis didn't interpret fields of global vars, because the vars were initialized before the fields were added to the "allowlist". Now, the allowlist is set _before_ init of globals.

Diff Detail

Event Timeline

ymandel created this revision.Jan 10 2023, 6:59 AM
Herald added a project: Restricted Project. · View Herald Transcript
ymandel requested review of this revision.Jan 10 2023, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 6:59 AM
sgatev accepted this revision.Jan 10 2023, 7:40 AM
This revision is now accepted and ready to land.Jan 10 2023, 7:40 AM
ymandel edited the summary of this revision. (Show Details)Jan 10 2023, 7:42 AM