bugKawa - Bugs: bug #21363, ArrayIndexOutOfBoundsException...

 
 

bug #21363: ArrayIndexOutOfBoundsException when compiling define-simple-class

Submitter:  Tamás Benkő <bentam>
Submitted:  Thu 18 Oct 2007 03:37:53 PM UTC
   
 
Category:  Code generation Severity:  3 - Normal
Item Group:  Compile-time exception Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 22 Oct 2007 01:39:44 AM UTC, comment #3: 

I checked in a fix which seems to work.

Per Bothner <bothner>
Group administrator
Sun 21 Oct 2007 01:19:38 PM UTC, comment #2: 

The version from SVN (1.9.3) compiles MiniTest.scm, but fails to compile DocTest.scm (included in the attachment of my original post):

$ java -cp /usr/local/share/java/kawa-1.9.3.jar kawa.repl -C DocTest.scm
(compiling DocTest.scm to DocTest)
DocTest.scm:10: internal error while compiling DocTest.scm
java.lang.Error: popType called with empty stack $N2d$Mnvector.<init>(DocTest,double)void
        at gnu.bytecode.CodeAttr.popType(CodeAttr.java:316)
        at gnu.bytecode.CodeAttr.emitInvokeMethod(CodeAttr.java:1316)
        at gnu.expr.PrimProcedure.compileInvoke(PrimProcedure.java:540)
        at gnu.expr.PrimProcedure.compile(PrimProcedure.java:522)
        at gnu.expr.PrimProcedure.compile(PrimProcedure.java:491)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:171)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:110)
        at gnu.expr.Expression.compileWithPosition(Expression.java:131)
        at gnu.expr.ClassExp.compile(ClassExp.java:479)
        at gnu.expr.ClassInitializer.<init>(ClassInitializer.java:16)
        at gnu.expr.ClassExp.compileSetField(ClassExp.java:735)
        at gnu.expr.SetExp.compile(SetExp.java:170)
        at gnu.expr.Expression.compileNotePosition(Expression.java:157)
        at gnu.expr.Expression.compileWithPosition(Expression.java:128)
        at gnu.kawa.functions.AppendValues.compile(AppendValues.java:50)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:171)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:110)
        at gnu.expr.Expression.compileWithPosition(Expression.java:146)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1500)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2017)
        at gnu.expr.Compilation.process(Compilation.java:1891)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:314)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:299)
        at kawa.repl.compileFiles(repl.java:790)
        at kawa.repl.processArgs(repl.java:444)
        at kawa.repl.main(repl.java:853)

It does however work if I pass --module-static to the compiler.

Tamás Benkő <bentam>
Sat 20 Oct 2007 09:16:06 PM UTC, comment #1: 

Could you try the version in SVN?
It seems to work there, you I get the warning:
/tmp/MiniTest.scm:5:1: warning - simple class requiring lexical link - use define-class instead

Compiling with --module-static avoids the problem.

Per Bothner <bothner>
Group administrator
Thu 18 Oct 2007 03:37:53 PM UTC, original submission:  

Using kawa 1.9.1, I can't seem to compile this piece of code:

(define-record-type <e>
  (make-e)
  e?)

(define-simple-class <d> ()
  ((f e) (e? e))
  ((init b) #!void))

(define (test)
  (<d> 0))

I've tried the example from "3.16.7 Defining new classes" in the manual too and got the same result.

The attached script contains the details.

Tamás Benkő <bentam>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #14165:  script.txt added by bentam (6KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Posted a comment)
  • -email is unavailable- added by bentam (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-22 bothner StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2007-10-20 bothner StatusNone Works For Me
        Assigned toNone bothner
    2007-10-18 bentam Attached File- Added script.txt, #14165

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code