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

 
 

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

Submitted by:  Tamás Benkő <bentam>
Submitted on:  Thu 18 Oct 2007 03:37:53 PM UTC  
 
Category: Code generationSeverity: 3 - Normal
Item Group: Compile-time exceptionStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

I checked in a fix which seems to work.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
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
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by bentam (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 Oct 2007 01:39:44 AM UTCbothnerStatusWorks For Me=>Fixed
      Open/ClosedOpen=>Closed
    Sat 20 Oct 2007 09:16:06 PM UTCbothnerStatusNone=>Works For Me
      Assigned toNone=>bothner
    Thu 18 Oct 2007 03:37:53 PM UTCbentamAttached File-=>Added script.txt, #14165

    Back to the top


    Powered by Savane 3.1-cleanup1