[M3devel] narrow still failing..

Rodney M. Bates rodney_bates at lcwb.coop
Wed Jan 22 20:46:55 CET 2014


Some more info:

The front end is generating incorrect narrow code, only
where the type T is an unrevealed <: REFANY.  When T and Root
are known, it calls RTHooks.CheckIsType for ISTYPE, NARROW,
and implicit narrow in an assignment.

When opaque, for explicit and implicit narrow, it simply compares
the typecode of x to a single typecode (no doubt for T) and demands
they be equal.  In this case, the actual allocated type of x is Root,
a proper subtype of T.

For ISTYPE, it does call CheckIsType even when the types are opaque.

The fact that it happens only when the types are opaque lends
credibility to the fact that this bug has gone unnoticed at least
as far back as PM3.

On 01/19/2014 04:01 PM, mika at async.caltech.edu wrote:
> As in the ISTYPE/TYPECASE example, the following works:
>
>
> PROCEDURE Z(VAR x : REFANY) =
>    BEGIN
>      TYPECASE x OF
>        BDD.T(b) => x := BDD.Format(b)
>      END;
>    END Z;
>
> (244)rover:~/refany/src>../FreeBSD4/refany
> a
>
>
> This does NOT work:
>
> PROCEDURE Z(VAR x : REFANY) =
>    BEGIN
>      TYPECASE x OF
>        BDD.T(b) => x := BDD.Format(x)
>      END;
>    END Z;
>
>
> (242)rover:~/refany/src>../FreeBSD4/refany
>
>
> ***
> *** runtime error:
> ***    NARROW failed
> ***    file "/big/home/mika/refany/src/Main.m3", line 22
> ***
>
>    use option @M3stackdump to get a stack trace
> Abort
>
>
> Same result PM3 / CM3.
>
>       Mika
>




More information about the M3devel mailing list