4 ms·
WASM is a little more different than that, because 0 is a valid memory address -- the beginning of the heap. As you would expect this has all kinds of wonderful
by IX-103 4y ago
WASM is a little more different than that, because 0 is a valid memory address -- the beginning of the heap.
As you would expect this has all kinds of wonderful ramifications for code that assumes 0 is nullptr.
- 10000truths 4y agoYes - as mentioned in the article, 0 being a valid memory address is an unexpected gotcha. My point is that, even though the C spec allows for such an environment, it still causes lots of problems in practice, so it should be addressed.
- int_19h 4y agoIt should be noted that such an environment has been extremely common back when C was designed, and for a couple decades thereafter. This isn't something new that has just been sprung up unexpected on C coders.
- gpderetta 4y agoNote that the constant 0 being the null pointer is not an assumption but it is guaranteed by the standard. Whether that maps to address 0 it is an implementation detail, but any implementation that doesn't do that is looking for trouble.