[m-rev.] for review: fix construct__get_functor/6

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 21 22:44:23 AEDT 2002


On 21-Nov-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Estimated hours taken: 0.5
> Branches: main, release
> 
> runtime/mercury_type_info.c:
> 	Fix a segfault in MR_arg_name_vector_to_list() (called by
> 	construct__get_functor/6) when none of the fields of the
> 	constructor being examined have names.

You should update the documentation for this function in
runtime/mercury_type_info.h to reflect this change.

> tests/hard_coded/construct.{m,exp}:
> 	Test construct__get_functor/6.

The file names are test_construct.{m,exp} not construct.{m,exp}.
Also you didn't post the diff for test_construct.m.

> Index: library/construct.m
...
> +            for (i = 0; i < Arity; i++) {
> +                ArgNameList = MR_list_cons_msg(NULL,
> +                                ArgNameList, MR_PROC_LABEL);
> +            }

Here you are calling MR_list_cons_msg() with the argument NULL,
whose type may be either an integer type or `void *',
The argument to MR_list_cons_msg() should have type MR_Word,
or something compatible with that, not `void *', so you need
to cast NULL to type MR_Word.

Check that this file compiles with warnings from the C compiler.

Otherwise that looks fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list