[PATCH] D134744: [clang][Interp] Implement rem opcode

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 23:50:44 PDT 2022


tbaeder marked an inline comment as done.
tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/Interp.h:164
+
+  if (RHS.isZero()) {
+    const SourceInfo &Loc = S.Current->getSource(OpPC);
----------------
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.


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

https://reviews.llvm.org/D134744



More information about the cfe-commits mailing list