Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354992

Summary: FOR statements generating incorrect SMAP lines
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Jeff Douglas <jeffdouglas>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mheitz
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Justin Spadea CLA 2011-08-17 14:28:49 EDT
function main()
	for (i int from 1 to 3) // LINE 8
		syslib.writestdout(i);
	end
end

The generated code is:
	int i = 0; // LINE 29
	for (i = (short) 1; i <= (short) 3; i += 1) {

The SMAP entry is: 8#1:29
The entry should be: 8#1:29,2

So the SMAP is only including the line for the counter declaration.

Neither of these problems exist if I declare the counter variable outside the for loop.
Comment 1 Jeff Douglas CLA 2011-09-02 09:37:05 EDT
Code needed to be added to the for statement to keep the smap processing flag on, indicating that there are multiple statements as part of the statement. There might be other complex statements that also need this, but none come to mind.
Comment 2 Justin Spadea CLA 2011-09-13 15:45:16 EDT
Verified