Simon Jakobi pushed to branch wip/sjakobi/mr16259 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • rts/wasm/JSFFI.c
    ... ... @@ -297,7 +297,9 @@ __attribute__((export_name("rts_promiseThrowTo")))
    297 297
     void rts_promiseThrowTo(HsStablePtr, HsJSVal);
    
    298 298
     void rts_promiseThrowTo(HsStablePtr sp, HsJSVal js_err) {
    
    299 299
       Capability *cap = &MainCapability;
    
    300
    -  StgWeak *w = (StgWeak *)deRefStablePtr(sp);
    
    300
    +  // Weak# pointers carry tag 1; see Note [Pointer tagging of unlifted boxed
    
    301
    +  // primitives] in GHC.StgToCmm.Prim. (The key field is stored untagged.)
    
    302
    +  StgWeak *w = (StgWeak *)UNTAG_CLOSURE((StgClosure *)deRefStablePtr(sp));
    
    301 303
       if (w->header.info == &stg_DEAD_WEAK_info) {
    
    302 304
         return;
    
    303 305
       }