clang-randstruct / llvm-project

Randomize the order of fields in a structure layout as a compile-time hardening feature
3 stars 1 forks source link

Do not randomize unions #23

Closed connorkuehl closed 5 years ago

connorkuehl commented 5 years ago

I just realized this code didn't come with our original port.

While it's technically harmless for our code to run over a union, it's wasted computation, and we don't need to add to the workload of the compiler.

Perhaps we could emit a compiler warning when a union is decorated with __attribute__((randomize_layout))?