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

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 27 16:17:35 PST 2019


erik.pilkington marked an inline comment as done.
erik.pilkington added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2921
+    atomicPHI->addIncoming(old, curBlock);
+    Builder.CreateCondBr(success, contBB, atomicOpBB);
     Builder.SetInsertPoint(contBB);
----------------
ahatanak wrote:
> Would passing `atomicPHI->getParent()` instead of `opBB` to `Builder.CreateCondBr` fix the crash?
Yeah, `atomicOpBB` and `atomicPHI->getParent()` should always be equal here. I'll update the patch to use this, since there is one less variable to keep track of.


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

https://reviews.llvm.org/D58744





More information about the cfe-commits mailing list