Bug 157379 - [compiler] VerifyError when unused local is assigned and unused locals are optimized out
Summary: [compiler] VerifyError when unused local is assigned and unused locals are op...
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-14 15:04 EDT by Olivier Thomann CLA
Modified: 2007-01-16 05:28 EST (History)
1 user (show)

See Also:


Attachments
Proposed fix (966 bytes, patch)
2006-09-14 15:05 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2006-09-14 15:04:31 EDT
Using latest 3.2.1 maintenance build, the following code compiles fine, but runs with a Verify error:

public class X {
	public static boolean test() {
		boolean b = false;
		assert b = true;
		return false;
	}
	public static void main(String[] args) {
		test();
	}
}

I'll attach the patch that has been done in HEAD.
Comment 1 Olivier Thomann CLA 2006-09-14 15:05:50 EDT
Created attachment 50195 [details]
Proposed fix

This is the fix done in HEAD.
The problem comes from the fact that the assignment implicit conversion is not set. In fact we might want to verify if this is intended.
Comment 2 Philipe Mulet CLA 2006-09-15 03:49:08 EDT
The piece from HEAD comes from a larger change for addressing bug 155255.
In bug 155255 there is a 3.2maintenance patch, which I was reluctant to release since it was late in 3.2.1 game, and fairly risky.

It could be released for 3.2.2, once we are confident about its stability (based on 3.3 testing).
Comment 3 Philipe Mulet CLA 2007-01-09 05:12:53 EST
Added LocalVariableTest#test013 (both in 3.2.2 and 3.3).
WORKSFORME with fix for bug 155255 which got released for 3.2.2.

Comment 4 Philipe Mulet CLA 2007-01-09 05:17:43 EST
Actually the test is: LocalVariableTest#test015
Comment 5 Eric Jodet CLA 2007-01-16 05:17:52 EST
verified for 3.2.2 using build M20070112-1200