[m-rev.] for review: fix rtti get_arg bugs for il grade

Peter Ross pro at missioncriticalit.com
Thu Nov 28 00:42:08 AEDT 2002


fjh wrote:
> On 26-Nov-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> > Fix bugs in get_arg when used with high-level data.
> >
> > library/rtti_implementation.m:
> > Fix a bug where the number of extra args in a functor where
>
> s/where/were/
>
> > being calculated according to whether or not a particular arg
> > of that functor was an existentially quantified type variable,
> > instead of just calculating the number of extra args from the
> > information in the exist_info for that functor.
> > Fix a bug where with high-level data the type of the secondary
> > tag doesn't matter for determing the offset to find a functors
> > arg.
>
> Test case?
>
cd tests/hard_coded/typeclasses
mmake GRADE=il existential_rtti.log

Printing myf(1) fails because of ExtraArgs not being calculated correctly.
Printing f(1, "hello", 42) fails because you don't need to add an offset for
the secondary tag when using high-level data on the IL backend.

Currently it now fails when trying to print out the notag type in the 6th
print.

> Does this bug show up for --target c --high-level-data
> (e.g. the `hl.gc' grade?)
>
No because rtti_implementation is only used currently by the IL backend.

> If not, the log message should mention that the problem only
> shows up for the `il' grade.
>
> > Index: library/rtti_implementation.m
> ...
> > +:- pred high_level_data is semidet.
> > +:- pragma promise_pure(high_level_data/0).
> > +:- pragma foreign_proc("MC++", high_level_data,
> > + [will_not_call_mercury, thread_safe], "
> > +#ifdef MR_HIGHLEVEL_DATA
> > + SUCCESS_INDICATOR = MR_TRUE;
> > +#else
> > + SUCCESS_INDICATOR = MR_FALSE;
> > +#endif
> > +").
> > +high_level_data :-
> > + fail.
>
> That is wrong for the `hl*' and `java' grades.
>
> Also, I think `fail' needs to be `semidet_fail' to avoid
> a determinism warning for non-il grades.
>
Yes I am going to change this to a
private_builtin__sorry("high_level_data").



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 11/19/2002

--------------------------------------------------------------------------
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