Duncan Coutts pushed to branch wip/dcoutts/io-manager-io-primop-exceptions at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • rts/PrimOps.cmm
    ... ... @@ -2314,22 +2314,22 @@ stg_waitReadyFd ( W_ fd, CInt rw )
    2314 2314
         (result) = ccall syncIOWaitReady(Capability_iomgr(MyCapability()) "ptr",
    
    2315 2315
                                          CurrentTSO "ptr", rw, fd);
    
    2316 2316
     
    
    2317
    -    /* See Note [Encoding of I/O manager operation results to primops] */
    
    2317
    +    /* See Note [Encoding of result of I/O manager operations] */
    
    2318 2318
     
    
    2319 2319
         /* case IOSubmitResultAsyncContinue */
    
    2320
    -    if (result == 0) (likely: True) {
    
    2320
    +    if (result == 0::CInt) (likely: True) {
    
    2321 2321
             /* See Note [Thread blocking for new I/O primops] */
    
    2322 2322
             jump stg_block_io_unit();
    
    2323 2323
         }
    
    2324 2324
     
    
    2325 2325
         /* case IOSubmitResultSyncSuccess*/
    
    2326
    -    if (result == 1) {
    
    2326
    +    if (result == 1::CInt) {
    
    2327 2327
             /* Success, don't even go via scheduler. */
    
    2328 2328
             return ();
    
    2329 2329
         }
    
    2330 2330
     
    
    2331 2331
         /* negative numbers are -errno error codes */
    
    2332
    -    if (result < 0) {
    
    2332
    +    if (result < 0::CInt) {
    
    2333 2333
             /* See Note [Calling convention for raisePrimIOException] */
    
    2334 2334
             W_ dummyR1; W_ errno;
    
    2335 2335
             dummyR1 = 0;
    
    ... ... @@ -2339,7 +2339,7 @@ stg_waitReadyFd ( W_ fd, CInt rw )
    2339 2339
         }
    
    2340 2340
     
    
    2341 2341
         /* case IOSubmitResultHeapOverflow */
    
    2342
    -    if (result == 2) {
    
    2342
    +    if (result == 2::CInt) {
    
    2343 2343
             jump stg_raisezh(HsIface_heapOverflow_closure(W_[ghc_hs_iface]));
    
    2344 2344
     
    
    2345 2345
         }