summaryrefslogtreecommitdiff
path: root/rts/CheckUnload.c
diff options
context:
space:
mode:
authorPhuong Trinh <lolotp@fb.com>2019-04-25 18:44:02 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-13 02:48:50 -0400
commitfc6b23be509e290f8d27775a1c637284a335ed81 (patch)
treee977d63250a03296011b58434034cb2c471bf43f /rts/CheckUnload.c
parent5ffc266e9c5ec8ed6010835165a65bd1f6b56dd4 (diff)
downloadhaskell-fc6b23be509e290f8d27775a1c637284a335ed81.tar.gz
Fix #16525: ObjectCode freed wrongly because of lack of info header check
`checkUnload` currently doesn't check the info header of static objects. Thus, it may free an `ObjectCode` struct wrongly even if there's still a live static object whose info header lies in a mapped section of that `ObjectCode`. This fixes the issue by adding an appropriate check.
Diffstat (limited to 'rts/CheckUnload.c')
-rw-r--r--rts/CheckUnload.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/CheckUnload.c b/rts/CheckUnload.c
index 0af9f464a1..f658d2c73d 100644
--- a/rts/CheckUnload.c
+++ b/rts/CheckUnload.c
@@ -404,6 +404,7 @@ void checkUnload (StgClosure *static_objects)
p = UNTAG_STATIC_LIST_PTR(p);
checkAddress(addrs, p, s_indices);
info = get_itbl(p);
+ checkAddress(addrs, info, s_indices);
link = *STATIC_LINK(info, p);
}