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

2018-02-23 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. Thanks for the review. Explicit `this` usage is a good test, added it. Checked that it happened to work with my previous approach because initializer was `CXXDefaultInitExpr` with expression ImplicitCastExpr 0x7fe966808c40 'void *' `-CXXThisExpr 0x7fe966808c28

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

2018-02-23 Thread Volodymyr Sapsai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL325997: [ExprConstant] Fix crash when initialize an indirect field with another field. (authored by vsapsai, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

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

2018-02-23 Thread Volodymyr Sapsai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325997: [ExprConstant] Fix crash when initialize an indirect field with another field. (authored by vsapsai, committed by ). Changed prior to commit:

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

2018-02-23 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Looks good, thanks! In https://reviews.llvm.org/D42498#1015419, @vsapsai wrote: > In https://reviews.llvm.org/D42498#1007028, @rsmith wrote: > > > […] your approach will still go wrong if the

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

2018-02-23 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 135708. vsapsai added a comment. - Override `This` for indirect field initializer more like it is done for `InitListExpr`. I rebased my changes, so the diff between different versions can be noisy. https://reviews.llvm.org/D42498 Files:

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

2018-02-21 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. Thanks for response, Richard. I'll look into using `CXXDefaultInitExpr`. As for In https://reviews.llvm.org/D42498#1007028, @rsmith wrote: > […] your approach will still go wrong if the `This` pointer is used in other > ways, such as an explicit mention of `this` or a

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

2018-02-13 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
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

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

2018-02-13 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. Herald added a subscriber: jkorous-apple. Ping. https://reviews.llvm.org/D42498 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-01-24 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai created this revision. vsapsai added reviewers: rsmith, efriedma. When indirect field is initialized with another field, you have MemberExpr with CXXThisExpr that corresponds to the field's immediate anonymous parent. But 'this' was referring to the non-anonymous parent. So when we were