[m-rev.] diff: fix tail call outputing bug

Peter Ross peter.ross at miscrit.be
Tue Feb 12 01:48:22 AEDT 2002


Fergus wrote:

> On 08-Feb-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> > compiler/mlds_to_il.m:
> >     The callee return type must be compatible with the caller return
> >     type for a tail call on the IL backend, not just for verifiable
code
> >     but for any code.
>
> Not according to the ECMA spec, last time I looked.
>
Yes, you are correct, I checked the spec but misunderstood it.

However isn't it a bug in the spec that this condition is specified in
the verifiability section rather than as a correctness condition.  I
can't see how code could possibly be correct if the tail call is allowed
to return a different type to the one returned by the caller.  The
caller can't return the value so the callee is responsible for doing so
the types must have to be compatible, anything else would be a bug.

> If Microsoft's implementation doesn't support that, then it
> is a bug in Microsoft's implementation.
>
> This code should be documented as a bug work-around.
>
> (Perhaps we should even add an `--work-around-MS-clr-bugs' option ;-)

That might not be a bad idea, it would allow us to quickly find all the
spots where we have hacked around bugs.

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