bugKawa - Bugs: bug #39940, Class member of type...

 
 

bug #39940: Class member of type <procedure> compilation exception

Submitted by:  Matthieu Vachon <maoueh>
Submitted on:  Wed 04 Sep 2013 01:47:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: 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.

 

Tue 10 Sep 2013 07:31:05 AM UTC, comment #1:

This one was tricky, and I ended up checking in a work-around rather than a proper fix.

The problem is when a context-free lambda is bound to a non-static field. I.e. a lambda that does not need a closure because it doesn't reference non-static variables. Such a field could be static, and the compiler is set up to optimize such variables to static fields. The compiler gets confused when the field is non-static. I tried fixing this cleanly but failed - there are a lot of interactions. (This may be easier to fix if/when we change to use MethodHandles instead of compiling switches in ModuleBody instances, since getting rid of the need for ModuleBody will avoid some of the complications.)

Instead I implemented a work-around is mostly right (a little more conservative than ideal), and which avoids triggering the bug, at least in cases I've tried. I checked in this "fix" along with your test-case and some related tests.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Wed 04 Sep 2013 01:47:29 PM UTC, original submission:

Consider the following snippet:

This snippet will not compile and will generate a `NullPointerException`. However, changing the member `(callback type: <procedure>)` to `(callback type: <procedure> init-value: (lambda _ #f))` will pass compilation correctly. In fact, adding any init-value seems to work correctly (compilation pass, but as expected, a ClassCastException is thrown when init-value is not a procedure).

I attached my test-case to this bug report.

Regards,
Matt

Matthieu Vachon <maoueh>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #29005:  procedure-set.scm added by maoueh (315B - application/octet-stream - Test case)

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 10 Sep 2013 07:31:05 AM UTCbothnerStatusNone=>Fixed
      Assigned toNone=>bothner
      Open/ClosedOpen=>Closed
    Wed 04 Sep 2013 01:47:29 PM UTCmaouehAttached File-=>Added procedure-set.scm, #29005

    Back to the top


    Powered by Savane 3.1-cleanup1