bugKawa - Bugs: bug #42689, Bytecode verify error involving...

 
 

bug #42689: Bytecode verify error involving use of "location"

Submitted by:  None
Submitted on:  Sat 05 Jul 2014 06:16:13 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.

 

Sun 06 Jul 2014 05:52:30 PM UTC, comment #1:

Once I figured out what was going on, this turned out to be fairly simple: The 'location' tried to set the 'value' field to be indirect (i.e. use a Location object), but that is inconsistent with an explicit type-specifier. So don't tr to make the field indirect.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sat 05 Jul 2014 06:16:13 PM UTC, original submission:

This code:

#| begin test.scm contents |#
(define-macro (increment! var delta)
(let ((loc (gentemp))) `(let ((,loc (location ,var))) (set! (,loc) (+ (,loc) ,delta))))
)

(define-simple-class accumulator ()
(value::double 0)
;if the next line is uncommented, and the line after that commented, the example works as expected
;((accumulate delta::double) (increment! (field (this) "value") delta))
((accumulate delta::double) (increment! value delta))
)

(define x (accumulator))
(x:accumulate .5)
(display x:value) (newline)
#| end test.scm contents |#

when compiled and run as "java kawa.repl --main -C test.scm && java test" gives the following output:
-----
(compiling test.scm to test)
java.lang.VerifyError: (class: accumulator, method: $finit$ signature: ()V) Incompatible object argument for function call
at test.run(test.scm:5)
at gnu.expr.ModuleBody.runAsMain(ModuleBody.java:152)
at test.main(test.scm)
-----

Explicitly accessing the field, as in the commented line, works correctly.

This happens both with the binary distribution kawa-1.14.jar, and with a copy built from SVN revision 7945.

----------

In response to the "Did you check to see if this item has already been submitted?" prompt: Bug #14640 looks like it has a similar triggering condition (usage of location to achieve single-evaluation in the spirit of CL's get-setf-expansion), but different output.

Anonymous

 

(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)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 06 Jul 2014 05:52:30 PM UTCbothnerStatusNone=>Fixed
      Assigned toNone=>bothner
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1