Skip to content
Snippets Groups Projects
  • Sylvain Henry's avatar
    7f203d00
    Numeric exceptions: replace FFI calls with primops · 7f203d00
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    ghc-bignum needs a way to raise numerical exceptions defined in base
    package. At the time we used FFI calls into primops defined in the RTS.
    These FFI calls had to be wrapped into hacky bottoming functions because
    "foreign import prim" syntax doesn't support giving a bottoming demand
    to the foreign call (cf #16929).
    
    These hacky wrapper functions trip up the JavaScript backend (#21078)
    because they are polymorphic in their return type. This commit
    replaces them with primops very similar to raise# but raising predefined
    exceptions.
    7f203d00
    History
    Numeric exceptions: replace FFI calls with primops
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    ghc-bignum needs a way to raise numerical exceptions defined in base
    package. At the time we used FFI calls into primops defined in the RTS.
    These FFI calls had to be wrapped into hacky bottoming functions because
    "foreign import prim" syntax doesn't support giving a bottoming demand
    to the foreign call (cf #16929).
    
    These hacky wrapper functions trip up the JavaScript backend (#21078)
    because they are polymorphic in their return type. This commit
    replaces them with primops very similar to raise# but raising predefined
    exceptions.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.