Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This jumped out at me too. GCC's documentation says:

Data prefetch does not generate faults if addr is invalid, but the address expression itself must be valid. For example, a prefetch of p->next does not fault if p->next is not a valid address, but evaluation faults if p is not a valid address.

This seems to make the code as presented incorrect (i.e. it results in undefined behavior).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: