Skip to content
Commit a0138390 authored by Shafik Yaghmour's avatar Shafik Yaghmour
Browse files

[Clang] Diagnose undefined behavior in a constant expression while evaluating...

[Clang] Diagnose undefined behavior in a constant expression while evaluating a compound assignment with remainder as operand

Currently we don't diagnose overflow in a constant expression for the case of
compound assignment with remainder as a operand.

In handleIntIntBinOp the arguments LHS and Result can be the same source but in
the check for remainder in this function we assigned to Result before checking
for overflow. In all the other operations the check is done before Result is
assigned to.

Differential Revision: https://reviews.llvm.org/D140455
parent ed001018
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment