Estimated hours taken: 3
Branches: main, release
Fix a bug where MR_deep_copy() was crashing when copying closures
for polymorphic predicates.
runtime/mercury_layout_util.h:
runtime/mercury_layout_util.c:
Add MR_materialize_closure_typeinfos(),
for use by mercury_deep_copy_body.h.
runtime/mercury_deep_copy.c:
#include mercury_layout_util.h, for MR_materialize_closure_typeinfos().
runtime/mercury_deep_copy_body.h:
Fix a bug: when copying closures, use MR_materialize_closure_typeinfos()
to get the type_infos for the already-applied closure arguments
from the closure itself, rather than trying to get them from
the arguments of the typeinfo for the closure (the latter holds
the type-infos for the yet-to-be-applied arguments, not the
already-applied arguments).
tests/hard_coded/Mmakefile:
tests/hard_coded/copy_pred_2.m:
tests/hard_coded/copy_pred_2.exp:
Add a test case.