[PATCH] D37597: [ubsan] Function Sanitizer: Don't require writable text segments

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 16:22:32 PDT 2017


pcc accepted this revision.
pcc added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!



================
Comment at: lib/CodeGen/CodeGenFunction.cpp:461
+                         ? EncodedAddr
+                         : Builder.CreateSExt(EncodedAddr, IntPtrTy);
+  auto *FuncAsInt = Builder.CreatePtrToInt(F, IntPtrTy, "func_addr.int");
----------------
Is this conditional necessary? I believe that `IRBuilder` will return the same value back if you cast to the same type.


https://reviews.llvm.org/D37597





More information about the cfe-commits mailing list