File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -243,22 +243,14 @@ bool ByteCodeExprGen<Emitter>::VisitBinaryOperator(const BinaryOperator *BO) {
243243 std::optional<PrimType> RT = classify (RHS->getType ());
244244 std::optional<PrimType> T = classify (BO->getType ());
245245
246- auto Discard = [this , T, BO](bool Result) {
247- if (!Result)
248- return false ;
249- return DiscardResult ? this ->emitPop (*T, BO) : true ;
250- };
251-
252246 // Deal with operations which have composite or void types.
253247 if (BO->isCommaOp ()) {
254248 if (!this ->discard (LHS))
255249 return false ;
256250 if (RHS->getType ()->isVoidType ())
257251 return this ->discard (RHS);
258252
259- // Otherwise, visit RHS and optionally discard its value.
260- return Discard (Initializing ? this ->visitInitializer (RHS)
261- : this ->visit (RHS));
253+ return this ->delegate (RHS);
262254 }
263255
264256 if (!LT || !RT || !T)
@@ -285,6 +277,12 @@ bool ByteCodeExprGen<Emitter>::VisitBinaryOperator(const BinaryOperator *BO) {
285277 return true ;
286278 };
287279
280+ auto Discard = [this , T, BO](bool Result) {
281+ if (!Result)
282+ return false ;
283+ return DiscardResult ? this ->emitPop (*T, BO) : true ;
284+ };
285+
288286 switch (BO->getOpcode ()) {
289287 case BO_EQ:
290288 return MaybeCastToBool (this ->emitEQ (*LT, BO));
Original file line number Diff line number Diff line change @@ -929,6 +929,7 @@ namespace DiscardExprs {
929929 (bool )1 ;
930930 __null;
931931 __builtin_offsetof (A, a);
932+ 1 ,2 ;
932933
933934 return 0 ;
934935 }
You can’t perform that action at this time.
0 commit comments