Bug 93588

Summary: [compiler] java.lang.VerifyError: Looks similar to 60040 but is happening on current release
Product: [Eclipse Project] JDT Reporter: Gary Hewett <Gary.Hewett>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: Darin_Swanson
Version: 3.0.2   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Sample code which exhibits problem behaviour none

Description Gary Hewett CLA 2005-05-03 16:17:58 EDT
Problem occurs during "running" of a Java application:

java.lang.VerifyError: (class: com/quickbusiness/courier/Class2, method: run
signature: ()V) Expecting to find long on stack
Exception in thread "main" 

I *think* I've narrowed it down to this line in the code...

Thread.sleep(interval = interval + 100);

I've created a dummy class which exhibits this problem. I'll try to attach that
Class as a seperate file.

PS: I don't claim to be the worlds greatest programmer so go easy on me please :)
Comment 1 Gary Hewett CLA 2005-05-03 16:19:44 EDT
Created attachment 20653 [details]
Sample code which exhibits problem behaviour
Comment 2 Gary Hewett CLA 2005-05-03 16:20:49 EDT
Problem is also occuring identically on Mac Powerbook G4 
Comment 3 Gary Hewett CLA 2005-05-03 16:28:39 EDT
Confirmed - I changed this line in my "real" code and things now run under Eclipse. 

Old: 
     Thread.sleep(interval = interval + 100);

New: 
     interval = interval + 100;
     Thread.sleep(interval);

Yet the "old" code both compiles and runs under the "same" jar in Windows and
Mac when I run from the command line. 
Comment 4 Darin Swanson CLA 2005-05-03 16:33:50 EDT
Moving to JDT Core...
Comment 5 Philipe Mulet CLA 2005-05-09 09:44:17 EDT
Reproduced in 3.1 stream as well.
Comment 6 Philipe Mulet CLA 2005-05-09 10:01:15 EDT
Also note that:
    Thread.sleep(interval += 100);
would work fine.
Somehow one bytecode generation is losing the conversion from int to long, when
optimizing "interval = interval + 100" into "interval += 100".
Comment 7 Philipe Mulet CLA 2005-05-09 12:44:03 EDT
Optimized code gen was missing extra implicit conversion on SingleNameReference.
Also fixed eval side.

Added AssignmentTest#test037.
Fixed
Comment 8 Olivier Thomann CLA 2005-05-11 13:38:52 EDT
Verified in I20050510-0010 + JDT/Core from HEAD.