Fix a C error I introduced when factoring out a C function from the

Estimated hours taken: 0.2
Branches: main

library/deconstruct.m:
	Fix a C error I introduced when factoring out a C function from the
	body of a foreign_proc: pass the right procedure id to the macros
	for recording memory allocations. This slipped through testing because
	this id is ignored in all grades except memprof grades. This change
	should fix the recent install failures on machines that install
	the memprof grade, such as jupiter.
This commit is contained in:
Zoltan Somogyi
2004-03-23 07:41:59 +00:00
parent ab89e08a42
commit a2be9fe63e

View File

@@ -1132,6 +1132,12 @@ get_functor_info(Univ, FunctorInfo) :-
:- pragma foreign_code("C", "
/*
** MR_make_arg_list is called from only one place above. If this changes, we
** will need a mechanism to charge the memory we allocate here to the
** right caller.
*/
MR_Word
MR_make_arg_list(MR_TypeInfo type_info, const MR_DuFunctorDesc *functor_desc,
MR_Word *arg_vector)
@@ -1139,7 +1145,7 @@ MR_make_arg_list(MR_TypeInfo type_info, const MR_DuFunctorDesc *functor_desc,
int i;
MR_Word args;
args = MR_list_empty_msg(MR_PROC_LABEL);
args = MR_list_empty_msg(mercury__deconstruct__get_du_functor_info_5_0);
for (i = functor_desc->MR_du_functor_orig_arity - 1; i >= 0; i--) {
MR_Word arg;
MR_TypeInfo arg_type_info;
@@ -1156,7 +1162,8 @@ MR_make_arg_list(MR_TypeInfo type_info, const MR_DuFunctorDesc *functor_desc,
}
MR_new_univ_on_hp(arg, arg_type_info, arg_vector[i]);
args = MR_univ_list_cons_msg(arg, args, MR_PROC_LABEL);
args = MR_univ_list_cons_msg(arg, args,
mercury__deconstruct__get_du_functor_info_5_0);
}
return args;