Comment

Comment by nyc_pizzadev

The point of the magic values are that these values are eventually checked. This should break out of these kinds of optimizations.

Edit note: allocators are user space libraries (stdlib) and not part of the C spec. Use-after-free is extremely unsafe, however its completely valid C.

2nd note: running all programs below give me the expected result, writes to pointers are live, regardless if they are freed. So please provide more concrete steps to reproduce your results.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton