odin-lang / odin-lang.org

http://odin-lang.org
19 stars 80 forks source link

Incorrect information about accessing invalid memory through dereferencing #188

Closed akbulutdora closed 4 months ago

akbulutdora commented 4 months ago

The documentation states that dereferencing an uninitialized pointer will cause a panic. However it causes a segfault.

gingerBill commented 4 months ago

Technically both are wrong.

On all the platforms except WASM, dereferencing the nil pointer will cause a segmentation fault. On WASM, this is currently perfectly valid to do (because WASM's memory model is pretty bad).

To be more correct, it might better to phrase it as something like the following:

platform specific behaviour, usually a segmentation fault on most platforms