[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 15 19:00:31 PST 2017


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:2321
+          !isa<llvm::StructType>(ConvertType(Arg->getType())) &&
           ArgI.getCoerceToType() == ConvertType(Ty) &&
           ArgI.getDirectOffset() == 0) {
----------------
I think the right fix is to change the second clause to ArgI.getCoerceToType() == ConvertType(Arg->getType()).  The point of this special case is to catch the common case that the natural way that IRGen wants to emit the argument expression is by producing a single scalar of exactly the right IR type; it seems to me that that condition would capture that correctly.


https://reviews.llvm.org/D41311





More information about the cfe-commits mailing list