Skip to content

rts: assert pointer is indeed heap allocated in Bdescr()

Cheng Shao requested to merge type-dance/ghc:bdescr-assert-heap-alloced into master

Inspired by #24492 (closed) and !12146 (merged), this patch adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs in C that attempt to access non-existent block descriptor of a static closure. The added assertion needs to access HEAP_ALLOCED_GC() in a public header, therefore HeapAlloc.h has been made public in this patch as well.

Merge request reports