[M3devel] how is this possible?
    mika at async.caltech.edu 
    mika at async.caltech.edu
       
    Sun Jan 19 04:40:06 CET 2014
    
    
  
Any hypothesis is welcome...
(311)truffles:~/t/btc/hparse/src>../AMD64_LINUX/hparse and.scm 
***
*** runtime error:
***    An explicit or implicit NARROW() operation failed.
***    file "../AMD64_LINUX/BDDSchemeStubs.m3", line 619
***
Abort
(312)truffles:~/t/btc/hparse/src>
    613 PROCEDURE ToModula_BDD_T(x : SchemeObject.T) : (BDD.T) RAISES { Scheme.E } =
    614   BEGIN
    615     IF x # NIL AND ISTYPE(x, REF BDD.T) THEN RETURN NARROW(x,REF BDD.T)^ END;
    616     IF NOT ISTYPE(x,BDD.T) THEN
    617       RAISE Scheme.E("Not of type BDD.T : " & SchemeUtils.Stringify(x))
    618     END;
    619     RETURN x
    620   END ToModula_BDD_T;
The object is of type BDD.Root (I checked the TYPECODE), which is
declared thus:
TYPE
  Root = T BRANDED Brand & " Root" OBJECT
    mu : MUTEX; (* as yet unused *)
    id : CARDINAL;
    tab : BDDTripleHash.T;
    cache : ARRAY Op OF BDDTripleHash.T;
  END;
SchemeObject.T is the same as REFANY
I'm not even sure where to start debugging this.  The code "should work"...
Indeed:
> (rttype-typecode a)
144
> (RTBrand.GetByTC 144)
"BDD 0.1 Root"
> (RTBrand.GetByTC 143)
"BDD 0.1"
> (RTType.Supertype 143)
4
(4 is REFANY)
> (BDD.And a a)
EXCEPTION! RuntimeError! An explicit or implicit NARROW() operation failed.
> a-and-a
<Modula-3 object : BDDImpl.Root, BRANDED BDD 0.1 Root>
> (rttype-typecode a-and-a)
144
     Mika
    
    
More information about the M3devel
mailing list