[PATCH] D36262: [ELF] - Do not forget to fill last bytes of PT_LOADs with trap instructions.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 07:43:12 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Writer.cpp:1815
 static void fillTrapInstr(uint8_t *I, uint8_t *End) {
   for (; I + 4 < End; I += 4)
     memcpy(I, &Target->TrapInstr, 4);
----------------
grimar wrote:
> ruiu wrote:
> > We can safely assume that End-I is a multiple of 4. So you want to change `<` to `<=` instead of adding a new line of code, no?
> Yes. And then what about inlining `fillTrapInstr`?
I think I still prefer outlining it.


https://reviews.llvm.org/D36262





More information about the llvm-commits mailing list