--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Thu Jul 15 20:57:25 1993
--* Received: from yktvmv2.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA13844; Thu, 15 Jul 1993 20:57:25 -0400
--* X-External-Networks: yes
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 1517; Thu, 15 Jul 93 20:58:25 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.EDWARDS.NOTE.YKTVMV.2001.Jul.15.20:58:25.-0400>
--*           for asbugs@watson; Thu, 15 Jul 93 20:58:25 -0400
--* Received: from ibm4.scri.fsu.edu by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Thu, 15 Jul 93 20:58:24 EDT
--* Received: by ibm4.scri.fsu.edu id AA18379
--*   (5.65c/IDA-1.4.4 for asbugs@watson.ibm.com); Thu, 15 Jul 1993 20:58:22 -0400
--* Date: Thu, 15 Jul 1993 20:58:22 -0400
--* From: Robert Edwards <edwards@ibm4.scri.fsu.edu>
--* Message-Id: <199307160058.AA18379@ibm4.scri.fsu.edu>
--* To: asbugs@watson.ibm.com
--* Subject: Run-time C code dereferencing nil pointer [bug9.as][A# version 29.2 for AIX RS/6000]

--@ Fixed  by:  PI   Thu Jan 20 11:29:23 EST 1994 
--@ Tested by:  none 
--@ Summary:    no more a bug. Note: now the rightmost BasicType in line 86 should be removed. 

--+ #### If I remove the first parameter to the category and domain, the
--+ #### code terminates without error.
--+
--+
--+ % asharp -v -Fx bug9.as
--+ A# version 29.2 for AIX RS/6000
--+ Exec: unicl -I/ds13/m/users/edwards/applications/asharp/base/rs3.2/include -c bug9.c
--+ Exec: xlc -I/ds13/m/users/edwards/applications/asharp/base/rs3.2/include -I/usr/include -c bug9.c
--+               ld in sc sy li pa ma ab ck sb ti gf of pb pl pc po mi
--+  Time   2.0s   0  1 .4 .4 .4  1  0 .4  0 .4 47 .9 .9  0  0  3 40 .4 %
--+  Source 132L : 3901 lines per minute
--+ Exec: unicl bug9.o -L/ds13/m/users/edwards/applications/asharp/base/rs3.2/lib -o  bug9 -laslib -lfoam -lm
--+ Exec: xlc -I/usr/include -obug9 bug9.o -L/ds13/m/users/edwards/applications/asharp/base/rs3.2/lib -L/lib -L/usr/lib -L/usr/local/lib -laslib -lfoam -lm
--+ %
--+ %
--+ % dbx bug9
--+ dbx version 3.1 for AIX.
--+ Type 'help' for help.
--+ reading symbolic information ...
--+ (dbx) run
--+ Here are the args: array(1, 2)
--+
--+ segmentation violation in ptrgl._ptrgl [bug9] at 0x10009d50
--+ 0x10009d50 (_ptrgl)    800b0000          l   r0,0x0(r11)
--+ (dbx) where
--+ ptrgl._ptrgl() at 0x10009d50
--+ C11_domainHash_BANG_(P0_td = (nil), e1 = (nil)), line 576 in "runtime.c"
--+ C5_addLevel1(0x2005d7e0, 0x20066a30) at 0x10000ea8
--+ C2_get(P0_dom = 0x2005d7c0, P1_name = 537291232, P2_type = 3735928559, P3_box = 0xdeadbeef, P4_skip = 0, e1 = 0x2005a000), line 190 in "runtime.c"
--+ C2_get(P0_dom = 0x10019488, P1_name = 3735928559, P2_type = 3735928559, P3_box = 0xdeadbeef, P4_skip = 3735928559, e1 = 0x2005582c), line 372 in "runtime.c"
--+ C10_domainGetExport_BANG_(P0_td = 0x43300000, P1_name = 2147483648, P2_type = 0, e1 = (nil)), line 545 in "runtime.c"
--+ C2_addLevel1(0x2005d0a0, 0x2005a270) at 0x10000ac0
--+ C9_domainPrepare_BANG_(P0_td = (nil), e1 = (nil)), line 521 in "runtime.c"
--+ main(0x1, 0x2ff7f7c8) at 0x100014f0
--+ (dbx) file runtime.c
--+ (dbx) list 567,577
--+   567   static FiWord
--+   568   C11_domainHash_BANG_(P0_td, e1)
--+   569           PFmt6 P0_td;
--+   570           FiEnv e1;
--+   571   {
--+   572           FiClos T0;
--+   573           PFmt11 l1;
--+   574           l1 = (PFmt11) fiEnvLevel(e1);
--+   575           T0 = ((PFmt9) P0_td->X0_dispatcher)->X2_hasher;
--+   576           return fiCCall1(FiWord, T0, P0_td->X1_domain);
--+   577   }
--+ (dbx) print l1
--+ (nil)
--+ (dbx) print T0
--+ 0x20051218
--+ (dbx) print P0_td
--+ (nil)
--+ (dbx) print P0_td->X0_dispatcher
--+ reference through nil pointer
--+ (dbx) quit
#include "aslib.as"

RAW ==>
    foo(m:Array R):% ==
      1$Integer pretend %

A(n:Integer,R:BasicType): Category == BasicType
 with
    foo: Array R -> %

    default RAW


D(n:Integer,R:BasicType): A(n,R) == add


import
  Integer
  Array Integer


args:Array Integer := [1,2]

print("Here are the args: ")(args)()

m:D(2,Integer) := foo(args)


 
