Skip to content

Commit f06e07b

Browse files
committed
[clang][Interp][NFC] Check pointer compound assign operators for errors
This needs to be done but we didn't use to do it.
1 parent 181d960 commit f06e07b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,10 +1446,13 @@ bool ByteCodeExprGen<Emitter>::VisitPointerCompoundAssignOperator(
14461446
if (!visit(RHS))
14471447
return false;
14481448

1449-
if (Op == BO_AddAssign)
1450-
this->emitAddOffset(*RT, E);
1451-
else
1452-
this->emitSubOffset(*RT, E);
1449+
if (Op == BO_AddAssign) {
1450+
if (!this->emitAddOffset(*RT, E))
1451+
return false;
1452+
} else {
1453+
if (!this->emitSubOffset(*RT, E))
1454+
return false;
1455+
}
14531456

14541457
if (DiscardResult)
14551458
return this->emitStorePopPtr(E);

0 commit comments

Comments
 (0)