Skip to content

Add poison

Ralf Jung requested to merge ralf/poison into master

Add a new poison literal that is used for uninitialized memory. Make sure that poison, when used in any interesting way, triggers UB -- the only think you may do with poison is load it from memory, and store it back. This models the PLDI'17 LLVM semantics for uninitialized memory pretty faithfully.

Also, get rid of unit because we can now use poison as the "return value" of things like storing, making sure that nothing can ever depend on those values.

Actually it turns out that the old unit and the new poison are exactly the same, so effectively this is just a rename + making allocation more deterministic.

Merge request reports