bugKawa - Bugs: bug #40835, Return types cause class cast...

 
 

bug #40835: Return types cause class cast exceptions

Submitted by:  Charles Turner <charlesturner>
Submitted on:  Sat 07 Dec 2013 04:33:52 PM UTC  
 
Category: Code generationSeverity: 3 - Normal
Item Group: Run-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 09 Dec 2013 12:11:07 AM UTC, comment #1:

The problem is that the parameter name 'list' clashed with the type specifier 'list'. I renamed the parameter name to 'lst' where needed.

I didn't notice the failures, because I've mostly been using Java 8 pre-releases, and lib-test.scm has various failures because of Unicode charset changes.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sat 07 Dec 2013 04:33:52 PM UTC, original submission:

There are four testsuite failures in the SVN 7711 trunk which don't seem to have been noticed:

%%%% Starting test libs (Writing full log to "libs.log")
./lib-test.scm:462: FAIL
./lib-test.scm:463: FAIL
./lib-test.scm:464: FAIL
./lib-test.scm:465: FAIL
...

The actual error is,
#|kawa:1|# (import (rnrs lists))
#|kawa:2|# (remp even? '(1 2 3 4 5))
java.lang.ClassCastException: cannot cast (1 2 3 4 5) to class-type
at gnu.kawa.lispexpr.LangObjType.coerceToClassType(LangObjType.java:362)
at kawa.lib.rnrs.lists.remp(lists.scm:243)

REMP, REMOVE, REMV, and REMQ are affected by this "return type" bug. Removing the return types from kawa/lib/rnrs/lists.scm "fixes" the problem. The two code generations are,

With return type
0: aload_1
1: invokestatic <Method gnu.kawa.lispexpr.LangObjType.coerceToClassType (java.lang.Object)gnu.bytecode.ClassType>
4: aload_0
5: invokestatic <Method kawa.lib.rnrs.lists.complement (gnu.mapping.Procedure)gnu.mapping.Procedure>
8: aload_1
9: invokestatic <Method kawa.lib.rnrs.lists.filter (gnu.mapping.Procedure,gnu.lists.LList)java.lang.Object>
12: invokevirtual <Method gnu.bytecode.Type.coerceFromObject (java.lang.Object)java.lang.Object>
15: areturn

Without return type
0: aload_0
1: invokestatic <Method kawa.lib.rnrs.lists.complement (gnu.mapping.Procedure)gnu.mapping.Procedure>
4: aload_1
5: invokestatic <Method kawa.lib.rnrs.lists.filter (gnu.mapping.Procedure,gnu.lists.LList)java.lang.Object>
8: areturn

Charles Turner <charlesturner>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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 charlesturner (Submitted the item)
  • -unavailable- added by charlesturner
  •  

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 09 Dec 2013 12:11:07 AM UTCbothnerStatusNone=>Fixed
      Assigned toNone=>bothner
      Open/ClosedOpen=>Closed
    Sat 07 Dec 2013 04:33:52 PM UTCcharlesturnerCarbon-Copy-=>Added charlesturner

    Back to the top


    Powered by Savane 3.1-cleanup1