summaryrefslogtreecommitdiff
path: root/rts/STM.c
diff options
context:
space:
mode:
authorBen.Lippmeier@anu.edu.au <unknown>2009-02-24 10:13:46 +0000
committerBen.Lippmeier@anu.edu.au <unknown>2009-02-24 10:13:46 +0000
commit9ecd4a3e69829f4c4ca6207043256cd40146556d (patch)
treecf8c6be4a08939a0e1d699aec259f44f3bc9e92a /rts/STM.c
parent42222f95a101fb3647f8728302bbf1098b74e59e (diff)
downloadhaskell-9ecd4a3e69829f4c4ca6207043256cd40146556d.tar.gz
Strip tag bits from closure pointers before trying to deference them.
Diffstat (limited to 'rts/STM.c')
-rw-r--r--rts/STM.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/STM.c b/rts/STM.c
index 9d93972e94..b9be955f55 100644
--- a/rts/STM.c
+++ b/rts/STM.c
@@ -306,7 +306,7 @@ static StgClosure *lock_tvar(StgTRecHeader *trec,
do {
do {
result = s -> current_value;
- } while (GET_INFO(result) == &stg_TREC_HEADER_info);
+ } while (GET_INFO(UNTAG_CLOSURE(result)) == &stg_TREC_HEADER_info);
} while (cas((void *)&(s -> current_value),
(StgWord)result, (StgWord)trec) != (StgWord)result);
return result;
@@ -1573,7 +1573,7 @@ static StgClosure *read_current_value(StgTRecHeader *trec STG_UNUSED, StgTVar *t
result = tvar -> current_value;
#if defined(STM_FG_LOCKS)
- while (GET_INFO(result) == &stg_TREC_HEADER_info) {
+ while (GET_INFO(UNTAG_CLOSURE(result)) == &stg_TREC_HEADER_info) {
TRACE("%p : read_current_value(%p) saw %p", trec, tvar, result);
result = tvar -> current_value;
}