News for hackers. Stuff that matters.
Re:WebAssembly doesn’t make unsafe languages safe by sigjuice on Sunday November 25, 2018 @08:19PM (#18530286)
n1256.pdf, Section 6.3.2.3 Pointers, says "constant expression with the value 0".

  An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.
I don't think this definition excludes platforms that use non-zero bit patterns. A constant 0 in C code should get converted to the appropriate (possibly non-zero) bit-pattern for the platform.

Also, my understanding is that whether the platform has useful things at address 0 falls in the category of "implementation defined".

Re:WebAssembly doesn’t make unsafe languages safe by int_19h on Sunday November 25, 2018 @11:06PM (#18530986)
> Also, my understanding is that whether the platform has useful things at address 0 falls in the category of "implementation defined".

If address zero is a null pointer, then IIRC no allocated object, whether static, automatic or heap, can have that address - i.e pointers to them must always compare unequal to nullptr.

If null pointer is something other than address zero, then it's just a regular address, and can have anything - it's not even "implementation defined", not anymore so than saying that e.g. 0x12345678 is a valid object address on x86.

Re:WebAssembly doesn’t make unsafe languages safe by saagarjha on Sunday November 25, 2018 @09:31PM (#18530591)
> I don't think this definition excludes platforms that use non-zero bit patterns.

It doesn't; the comment above yours is saying the same thing as you are.