[PATCH] D84913: [libFuzzer] Enable for SystemZ

Ilya Leoshkevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 09:12:24 PDT 2020


iii added a comment.

Ok, I'll split the patch.



================
Comment at: compiler-rt/lib/fuzzer/FuzzerTracePC.h:198
+    if (LargeType Bundle = *reinterpret_cast<const LargeType *>(P)) {
+#if __BYTE_ORDER == __BIG_ENDIAN
+      Bundle = Bswap(Bundle);
----------------
kcc wrote:
> please avoid #ifdefs inside functions. 
> If there is some logic that needs to depend on the platform, it needs to reside in a separate dedicated function. 
> 
> FuzzerBuiltins.h is probably the place for such a function. 
> 
> Also, what about 
>        #include <endian.h>
>        uint64_t htole64(uint64_t host_64bits);
> is that portable? 
> 
I think this might not work as expected on 32-bit systems. I'll add a separate function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84913



More information about the llvm-commits mailing list