[PATCH] D42498: [ExprConstant] Fix crash when initialize an indirect field with another field.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 17:48:52 PST 2018


rsmith added a comment.

Please handle this by temporarily updating the `This` pointer appropriately when evaluating the `CXXDefaultInitExpr` rather than trying to work around the `This` value being wrong later (your approach will still go wrong if the `This` pointer is used in other ways, such as an explicit mention of `this` or a member function call). You can refer to how we do this in CodeGen: look for `CodeGenFunction::CXXDefaultInitExprScope` and `CodeGenFunction::FieldConstructionScope`.


https://reviews.llvm.org/D42498





More information about the cfe-commits mailing list