[PATCH] D154275: [llvm-exegesis] Support older kernel versions in subprocess executor
Aiden Grossman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 02:03:48 PDT 2023
aidengrossman added a comment.
@courbet This should be ready for another round of review when you have time. Thanks!
================
Comment at: llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp:205
+
+ *((int *)CMSG_DATA(ControlMessage)) = FD;
+
----------------
courbet wrote:
> I think this is technically UB in C++ (it violates strict aliasing). I'd be more comfortable with `memcpy(CMSG_DATA(ControlMessage)), FD, sizeof(FD));`, which does the same thing while having defined semantics.
Thanks for the suggestion! I definitely wasn't particularly happy with that level of casting, not sure why a `memcpy` didn't come up to me. That is definitely a lot cleaner and avoids the UB (and compiler warning).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154275/new/
https://reviews.llvm.org/D154275
More information about the llvm-commits
mailing list