| Summary: | class cast exception evaluating detail formatter | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Darin Wright <darin.eclipse> |
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | markus.kell.r |
| Version: | 3.0 | ||
| Target Milestone: | 3.1 M3 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Darin Wright
Fixed.
There was a problem when trying to evaluate an 'if' statement, with as 'then'
body an expression/statement that returns an value, if the 'then' body was not
delimited by '{' '}'.
for example:
if (true)
toString();
When a statement is an method call that returns an value, a pop instruction is
added to remove the result of the method call from the execution stack.
To correctly create an 'if' statement, we need to know the size (in number of
instruction) of each part of the 'if' (condition, then body, else body).
But the pop instruction were not correctly created, and always returned a size
of 1, instead of 1 + the size of the operation which created the value to be
removed from the stack.
In result, the 'if' were not correctly created, the jumps were not added at the
right positions.
Pop - modified so it can be correctly initialized, and then return the correct
information.
ASTInstructionCompiler - updated to correctly create the pop instruction. Added
an helper method.
The walkaround is to add '{' '}' around the then/else body of the if.
Please verify, Darin W.
Verified. |