Open jamesjuett opened 2 years ago
It appears that it's getting assigned the value of its index reinterpreted as a pointer, probably from a bug in the special case implementation for stepping off the end. Specifically this manifests with ++, but it may manifest elsewhere.
++
void fill_ones(int *ptr) { while(*ptr) { *ptr = 1; ++ptr; } } int main() { int arr[5] = {3, 1, 4, 1, 5}; fill_ones(arr); }
It appears that it's getting assigned the value of its index reinterpreted as a pointer, probably from a bug in the special case implementation for stepping off the end. Specifically this manifests with
++
, but it may manifest elsewhere.