This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Don't crash when constructing an array of records.
ClosedPublic

Authored by mboehme on Jul 27 2023, 1:36 AM.

Details

Summary

When I wrote https://reviews.llvm.org/D155446, I assumed that a CXXConstructExpr would always have record type, but this isn't true: It can have array type when constructing an array of records. The code would crash in this situation because createValue() would return null.

This patch includes a test that reproduces the crash without the other changes in the patch.

Diff Detail

Event Timeline

mboehme created this revision.Jul 27 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald Transcript
mboehme requested review of this revision.Jul 27 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 1:36 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mboehme edited the summary of this revision. (Show Details)Jul 27 2023, 1:41 AM
mboehme added reviewers: sammccall, ymandel.
sammccall accepted this revision.Jul 27 2023, 2:00 AM
This revision is now accepted and ready to land.Jul 27 2023, 2:00 AM

CI failures look unrelated

This revision was landed with ongoing or failed builds.Jul 27 2023, 5:46 AM
This revision was automatically updated to reflect the committed changes.