[ASTImporter] Fix corrupted RecordLayout caused by circular referenced fields
UnaryOperator(&)'s creation might need layout of some records whose fields importation are still on fly, the layout is incorrectly computed and cached. Clients relying on this will not work properly or crash direclty (e.g StaticAnalyzer's MemRegion.cpp (calculateOffset)). Use UnaryOperator::CreateEmpty() instead of UnaryOperator::Create() to avoid this computation. Fixes https://github.com/llvm/llvm-project/issues/64170 Reviewed By: aaron.ballman, balazske, shafik Differential Revision: https://reviews.llvm.org/D156201
Loading
Please sign in to comment