[PATCH] D58744: [CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 27 16:12:09 PST 2019


ahatanak added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2921
+    atomicPHI->addIncoming(old, curBlock);
+    Builder.CreateCondBr(success, contBB, atomicOpBB);
     Builder.SetInsertPoint(contBB);
----------------
Would passing `atomicPHI->getParent()` instead of `opBB` to `Builder.CreateCondBr` fix the crash?


================
Comment at: clang/test/CodeGen/sanitize-atomic-int-overflow.c:3
+
+_Atomic(unsigned) atomic;
+
----------------
It's probably better to add some check strings here.


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

https://reviews.llvm.org/D58744





More information about the cfe-commits mailing list