[M3devel] narrow still failing..

Rodney M. Bates rodney_bates at lcwb.coop
Mon Jan 20 17:00:13 CET 2014


What does this do?

PROCEDURE Z(VAR x : REFANY) =
   VAR b: BDD.T;
   BEGIN
     b := x;
     x := BDD.Format(b)
   END Z;

The common property of the failing cases seems to be the necessity
of a runtime narrow check when passing x to BDD.Format.

So far, I haven't been able to reproduce the failure on AMD64_LINUX,
with even more irrelevant (one would think) stuff pared out.  I moved
T, Root, and Format into main, removed all but one fields of T and Root,
replaced BDD.New by NEW(Root) and removed Symtab and most of the body
from Format.

Looking at your code, I agree it should work.


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