Skip to content
  • Sylvain Henry's avatar
    Fix ghc-bignum exceptions · 1b3d13b6
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    We must ensure that exceptions are not simplified. Previously we used:
    
       case raiseDivZero of
          _ -> 0## -- dummyValue
    
    But it was wrong because the evaluation of `raiseDivZero` was removed and
    the dummy value was directly returned. See new Note [ghc-bignum exceptions].
    
    I've also removed the exception triggering primops which were fragile.
    We don't need them to be primops, we can have them exported by ghc-prim.
    
    I've also added a test for #18359 which triggered this patch.
    1b3d13b6