bugKawa - Bugs: bug #43233, Dumping circular literals

 
 

bug #43233: Dumping circular literals

Submitter:  Helmut Eller <ellerh>
Submitted:  Tue 16 Sep 2014 01:39:45 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 18 Sep 2014 05:26:16 AM UTC, comment #1: 

Oops.  Added a fix and a test-case.

The framework for compiling literals does support cycles.  The problem is that PairWithPosition objects are immutable.  To handle a cycle, we have to first allocate the object and then later set the fields, so we essentially needed a back-door.

Per Bothner <bothner>
Group administrator
Tue 16 Sep 2014 01:39:45 PM UTC, original submission:  

Apparently Kawa can't dump circular literals.  Given this file:

(define (foo) '#1=(0 . #1#))

the compiler aborts with an error:

shell> kawa --version
Kawa 1.14.1 (revision 7749:8044M)
shell> kawa -C test.scm
(compiling test.scm to test)
Exception in thread "main" java.lang.Error: no method to construct ClassType gnu.lists.PairWithPosition
        at gnu.expr.LitTable.error(LitTable.java:103)
        at gnu.expr.LitTable.emit(LitTable.java:656)
        at gnu.expr.LitTable.emit(LitTable.java:73)
        at gnu.expr.Compilation.generateBytecode(Compilation.java:2250)
        at gnu.expr.Compilation.process(Compilation.java:1990)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:309)
        at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:290)
        at kawa.repl.compileFiles(repl.java:824)
        at kawa.repl.processArgs(repl.java:444)
        at kawa.repl.main(repl.java:871)
[Exit 1]


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

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-18 bothner StatusNone Fixed
        Assigned toNone bothner
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code