aaron.ballman added inline comments.

================
Comment at: clang/lib/AST/Interp/Interp.h:170
+
+  if (LHS.isSigned() && LHS.isMin() && RHS.isNegative() && RHS.isMinusOne()) {
+    APSInt LHSInt = LHS.toAPSInt();
----------------
I really like how clear and generalized this predicate is!


================
Comment at: clang/lib/AST/Interp/Interp.h:164
+
+  if (RHS.isZero()) {
+    const SourceInfo &Loc = S.Current->getSource(OpPC);
----------------
tbaeder wrote:
> shafik wrote:
> > You also need to catch when the result is not representable e.g `INT_MIN % 
> > -1`
> > 
> > see `CheckICE(...)`
> I added the check here some lines below; Is that alright? If so I'd add the 
> same code to the `div()` implementation.
Looks correct to me.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134744/new/

https://reviews.llvm.org/D134744

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to