Skip to content
  • Sylvain Henry's avatar
    df9fd9f7
    JS: handle stored null StablePtr · df9fd9f7
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    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
    JS: handle stored null StablePtr
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    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).
Loading