Summary: | [1.6][compiler] NegativeArraySizeException in StackMapFrame.duplicate | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Chris West (Faux) <eclipse> | ||||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann, ralf, srikanth_sankaran | ||||||||
Version: | 3.6 | ||||||||||
Target Milestone: | 3.6 M5 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows Vista | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Chris West (Faux)
2009-12-19 09:45:00 EST
Created attachment 154840 [details]
Testcase
Created attachment 154841 [details]
Stacktrace
Full stack-trace from the UI. An additional log entry is generated with just the java.lang.NegativeArraySizeException in, but it's the same.
This is an invalid code that we don't reject properly. We should not try to generate the code for the method doThings(). This error should prevent the code from being generated for the enclosing method. ---------- 3. ERROR in D:\tests_sources\X.java (at line 11) throw new DomainException(); ^^^^^^^^^^^^^^^^^^^^^ No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instance of type X (e.g. x.new A() where x is an instance of X). The exception constructor cannot be referenced in a static context without an enclosing instance. I'll investigate why the code is generated with an error. The problem comes from the way the compilation is aborted while generating the anonymous type. The error is reported against the allocation expression for the exception and the outer most method is tagged as having error, but the inner method is not tagged as having error. Therefore the code generation continues till it fails. We should just make sure we can duplicate stack frames. Created attachment 155263 [details]
Proposed fix + regression test
Released for 3.6M5. Regression test added in: org.eclipse.jdt.core.tests.compiler.regression.StackMapAttributeTest#test046 Verified for 3.6M5 using build I20100122-0800. Verified. |