callIfIsObjptr takes an argument objptr *opp, and only calls a closure if isObjptr(*opp). But then the closure is passed opp, and it itself again dereferences *opp. In LC, this is safe due to no concurrent access on the object. In CC, this is unsafe (the value could change due to a concurrent write).
It should be a fairly simple fix. We just need to make sure that the value is read exactly once. Perhaps callIfIsObjptr should be removed, and the closure function should handle that case. Alternatively, we could have the closure take the read value as an additional argument.
callIfIsObjptr
takes an argumentobjptr *opp
, and only calls a closure ifisObjptr(*opp)
. But then the closure is passedopp
, and it itself again dereferences*opp
. In LC, this is safe due to no concurrent access on the object. In CC, this is unsafe (the value could change due to a concurrent write).It should be a fairly simple fix. We just need to make sure that the value is read exactly once. Perhaps
callIfIsObjptr
should be removed, and the closure function should handle that case. Alternatively, we could have the closure take the read value as an additional argument.