-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Labels
Description
The rd_kw_struct uses char *data to store different types (int, float, double, bool), then casts it to typed pointers:
Line 979 in 091b695
| return (ctype *)rd_kw->data; \ |
Compilers assume pointers of different types don't alias, enabling aggressive optimizations that can break the code.
It should either
- Use std::aligned_storage and placement new
- Use a union
- Compile with
-fno-strict-aliasing
We should probably also run tests with -fsanitize=undefined -fsanitize=address.