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

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 16:01:11 PDT 2017


pcc added inline comments.


================
Comment at: lib/CodeGen/CodeGenFunction.cpp:463
+  auto *PCRelAsInt =
+      Builder.CreatePtrToInt(EncodedAddr, IntPtrTy, "encoded_addr.int");
+  auto *FuncAsInt = Builder.CreatePtrToInt(F, IntPtrTy, "func_addr.int");
----------------
pcc wrote:
> Maybe use `Int32Ty` (here and below). That should be sufficient under the small code model.
Sorry, I meant that the difference could be truncated to `Int32Ty`, and stored as an integer, not a pointer.


https://reviews.llvm.org/D37597





More information about the cfe-commits mailing list