filcab added inline comments.
================
Comment at: lib/CodeGen/CGExprScalar.cpp:3854
+ const Twine &Name) {
+ Value *GEPVal = Builder.CreateInBoundsGEP(Ptr, IdxList, Name);
+
----------------
You're creating the GEP first (possibly triggering UB), and then checking
("after" UB). Shouldn't you put the checking instructions before the GEP?
================
Comment at: lib/CodeGen/CGExprScalar.cpp:3948
+ return GEPVal;
+
+ // Now that we've computed the total offset, add it to the base pointer (with
----------------
Do we want an extra test for `TotalOffset` being a constant + not overflowing?
(Not strictly need, but you've been working on avoiding __ubsan() calls :-) )
https://reviews.llvm.org/D33305
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits