bugKawa - Bugs: bug #32656, ArrayIndexOutOfBoundsException in...

 
 

bug #32656: ArrayIndexOutOfBoundsException in mergeLocalType

Submitter:  Helmut Eller <ellerh>
Submitted:  Wed 02 Mar 2011 05:14:12 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
   

Sat 05 Mar 2011 12:08:30 AM UTC, comment #1: 

Thanks.  I check in a fix, along with your test-case.

Per Bothner <bothner>
Group administrator
Wed 02 Mar 2011 05:14:12 PM UTC, original submission:  

Compiling this example:


(define (foo y)
  (letrec ((f (lambda (x)
                (case x
                  ((0) (f x))
                  ((1) (g x))
                  ((2) (h x)))))
           (g (lambda (x)
                (case x
                  ((0) (f x))
                  ((1) (g x))
                  ((2) (h x)))))
           (h (lambda (x)
                (case x
                  ((0) (f x))
                  ((1) (g x))
                  ((2) ;(h x)
                   x)))))
    (f y)))


with kawa --version -C inline4.scm aborts with this message:


Kawa 1.11 (revision 0:6912M)
Copyright (C) 2009 Per Bothner
(compiling inline4.scm to inline4)
inline4.scm:7: internal error while compiling inline4.scm
java.lang.ArrayIndexOutOfBoundsException: 2
        at gnu.bytecode.Label.mergeLocalType(Label.java:119)
        at gnu.bytecode.Label.notifyTypeChangeListeners(Label.java:135)
        at gnu.bytecode.Label.mergeLocalType(Label.java:123)
        at gnu.bytecode.Label.notifyTypeChangeListeners(Label.java:139)
        at gnu.bytecode.Label.mergeLocalType(Label.java:123)
        at gnu.bytecode.Label.notifyTypeChangeListeners(Label.java:139)
        at gnu.bytecode.Label.mergeLocalType(Label.java:123)
        at gnu.bytecode.Label.setTypes(Label.java:93)
        at gnu.bytecode.Label.setTypes(Label.java:105)
        at gnu.bytecode.CodeAttr.emitGoto(CodeAttr.java:1573)
        at gnu.bytecode.CodeAttr.emitTailCall(CodeAttr.java:2471)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:297)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:111)
        at gnu.expr.Expression.compileNotePosition(Expression.java:156)
        at gnu.expr.Expression.compileWithPosition(Expression.java:127)
        at gnu.expr.IfExp.compile(IfExp.java:118)
        at gnu.expr.IfExp.compile(IfExp.java:52)
        at gnu.expr.Expression.compileWithPosition(Expression.java:130)
        at gnu.expr.IfExp.compile(IfExp.java:130)
        at gnu.expr.IfExp.compile(IfExp.java:52)
        at gnu.expr.Expression.compileWithPosition(Expression.java:130)
        at gnu.expr.IfExp.compile(IfExp.java:130)
        at gnu.expr.IfExp.compile(IfExp.java:52)
        at gnu.expr.Expression.compileNotePosition(Expression.java:156)
        at gnu.expr.Expression.compileWithPosition(Expression.java:127)
        at gnu.expr.LetExp.compile(LetExp.java:196)
        at gnu.expr.Expression.compileNotePosition(Expression.java:156)
        at gnu.expr.Expression.compileWithPosition(Expression.java:127)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:307)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:111)
        at gnu.expr.Expression.compileNotePosition(Expression.java:156)
        at gnu.expr.Expression.compileWithPosition(Expression.java:127)
        at gnu.expr.BeginExp.compile(BeginExp.java:143)
        at gnu.expr.Expression.compileNotePosition(Expression.java:156)
        at gnu.expr.Expression.compileWithPosition(Expression.java:127)
        at gnu.expr.LetExp.compile(LetExp.java:196)
        at gnu.expr.Expression.compileNotePosition(Expression.java:156)
        at gnu.expr.Expression.compileWithPosition(Expression.java:142)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1619)
        at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1595)
        at gnu.expr.LambdaExp.compileSetField(LambdaExp.java:656)
        at gnu.expr.SetExp.compile(SetExp.java:168)
        at gnu.expr.Expression.compileNotePosition(Expression.java:156)
        at gnu.expr.Expression.compileWithPosition(Expression.java:142)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1619)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2014)
        at gnu.expr.Compilation.process(Compilation.java:1892)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:305)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:290)
        at kawa.repl.compileFiles(repl.java:783)
        at kawa.repl.processArgs(repl.java:412)
        at kawa.repl.main(repl.java:829)


Helmut Eller <ellerh>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 ellerh (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
    2011-03-05 bothner CategoryNone Code generation
        Item GroupNone Compile-time exception
        StatusNone Fixed
        Assigned toNone bothner
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code