Skip to content
  • Simon Marlow's avatar
    Fix a really nasty bug in SMP · a9dc9658
    Simon Marlow authored
    In SMP mode a THUNK can change to an IND at any time.  The generic
    apply code (stg_ap_p etc.) examines a closure to determine how to
    apply it to its arguments, if it is a THUNK it must enter it first in
    order to evaluate it.  The problem was that in order to enter the
    THUNK, we were re-reading the info pointer, and possibly ending up
    with an IND instead of the original THUNK.  It isn't safe to enter the
    IND, because it points to a function (functions are never "entered",
    only applied).  Solution: we must not re-read the info pointer.
    a9dc9658