-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
Description
UBSAN reports undefined behaviour in this code:
volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h
Lines 112 to 113 in 42f57cd
| d->w[i / (sizeof(unsigned int) * 8 / 2) + | |
| s * (sizeof(decision_t) / sizeof(unsigned int))] |= |
Here w is an unsigned int[2], and the s * (sizeof(decision_t) / sizeof(unsigned int)) calculation intentionally reaches outside the bounds of the array to access the sth element of the outer decision_t array d.
It looks like this hack became necessary because sizeof(decision_t) is 8, and yet it is marked as being 16-byte aligned; because of this, accessing d[1] (or any other odd offset) fails due to misalignment. I suspect that the 16-byte alignment of decision_t is incorrect or unnecessary.