Skip to content

Commit

Permalink
Invoke GC_oom_fn if GC_make_array_descriptor failed because of no memory
Browse files Browse the repository at this point in the history
(a cherry-pick of commit 223ce4f from 'master')

* typd_mlc.c (GC_calloc_explicitly_typed): If descr_type is NO_MEM then
return the result of GC_get_oom_fn()(lb) instead of NULL.
  • Loading branch information
ivmai committed Apr 28, 2023
1 parent c6f8a7a commit 4ef1a3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion typd_mlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_calloc_explicitly_typed(size_t n,
&complex_descr, &leaf);
lb *= n;
switch(descr_type) {
case NO_MEM: return(0);
case NO_MEM:
return (*GC_get_oom_fn())(lb);
case SIMPLE:
return GC_malloc_explicitly_typed(lb, simple_descr);
case LEAF:
Expand Down

0 comments on commit 4ef1a3a

Please sign in to comment.