Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
5577 commits behind the upstream repository.
user avatar
Sylvain Henry authored
Some Haskell codes unsafely cast StablePtr into ptr to compare against
NULL. E.g. in direct-sqlite:

  if castStablePtrToPtr aggStPtr /= nullPtr then

where `aggStPtr` is read (`peek`) from zeroed memory initially.

We fix this by giving these StablePtr the same representation as other
null pointers. It's safe because StablePtr at offset 0 is unused (for
this exact reason).
df9fd9f7
History