Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354992 - FOR statements generating incorrect SMAP lines
Summary: FOR statements generating incorrect SMAP lines
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jeff Douglas CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-17 14:28 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:17 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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