Skip to content

RTS: Fix restrictive cast

Alec Theriault requested to merge harpocrates/ghc:fix-haddock-crash into master

Commit e75a9afd added an unsigned cast to account for OSes that have signed rlim_t signed. Unfortunately, the unsigned cast has the unintended effect of narrowing rlim_t to only 4 bytes. This leads to some spurious out of memory crashes (in particular: Haddock crashes with OOM whenn building docs of ghc-the-library).

In this case, W_ is a better type to cast to: we know it will be unsigned too and it has the same type as *len (so we don't suffer from accidental narrowing).

Merge request reports