Skip to content

Commit 502c69d

Browse files
authored
flambda-backend: Fix assertion in caml_ephe_clean (#2192)
1 parent 4d155c6 commit 502c69d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

runtime/caml/shared_heap.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ Caml_inline int is_marked(value v) {
8888
return Has_status_val(v, caml_global_heap_state.MARKED);
8989
}
9090

91+
Caml_inline int is_not_markable(value v) {
92+
return Has_status_val(v, NOT_MARKABLE);
93+
}
94+
9195
void caml_redarken_pool(struct pool*, scanning_action, void*);
9296

9397
intnat caml_sweep(struct caml_heap_state*, intnat);

runtime/weak.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ void caml_ephe_clean (value v) {
167167
else if (Is_block (child) && !Is_young (child)) {
168168
if (Tag_val (child) == Infix_tag) child -= Infix_offset_val (child);
169169
/* If we scanned all the keys and the data field remains filled,
170-
then the mark phase must have marked it */
171-
CAMLassert( is_marked (child) );
170+
then the mark phase must have marked it (or alternatively the
171+
value concerned is in static data etc). */
172+
CAMLassert( is_marked (child) || is_not_markable (child) );
172173
}
173174
#endif
174175
}

0 commit comments

Comments
 (0)