Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362641 - Debug js generator produce runtime error when there is label in EGL file
Summary: Debug js generator produce runtime error when there is label in EGL file
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Justin Spadea CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-02 04:57 EDT by Huang Ji Yong CLA
Modified: 2017-02-23 14:15 EST (History)
3 users (show)

See Also:


Attachments
Fix label generation (7.98 KB, patch)
2012-04-17 16:36 EDT, Justin Spadea CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Huang Ji Yong CLA 2011-11-02 04:57:31 EDT
The test case
f int = 5;
    function start()
    	myInt int = 5;    
        outerLoop: 
        while(f != 0)
            if(myInt == 1)
                exit outerLoop;
            end
            for(myInt from 1 to 100 by 1)
                if(f == 5)
                    exit for;
                end
            end
        end
        ;
        syslib.writeStdout("go here");
    end

The problem is in the generation of label and while statement
outerLoop: while(f != 0)

The development js generator generates the following js
egl.atLine(this.eze$$fileName,13,236,10, this);
EzeLabel_outerLoop: egl.atLine(this.eze$$fileName,13,247,235, this);	
while (((this.f != 0))) {

The correct js should be
egl.atLine(this.eze$$fileName,13,236,10, this);
EzeLabel_outerLoop: while (((this.f != 0))) {
Comment 1 Huang Ji Yong CLA 2011-11-03 05:04:13 EDT
Hi Justin,
This bug blocks the EUnit test case
api/systemTypes/languageStatements.egl function whileTest()
So I change the severity to major.

Brenda or Kathy,
Can you skip update the EUnit to skip this test case before this bug is resolved.
Thanks.
Comment 2 Justin Spadea CLA 2011-11-03 16:36:51 EDT
I spoke with Brian, and neither EXIT nor LABEL are supported in JSGen in RBD, so we decided to make this a 1.0 feature. I've updated the wiki to indicate it's not supported in 0.7.

To support this in debug mode we need to be able to generate a label in the middle of generating the statement that follows the label.

Please mark the testcase(s) as failed for now.
Comment 3 Justin Spadea CLA 2012-04-17 16:36:01 EDT
Created attachment 214145 [details]
Fix label generation
Comment 4 Justin Spadea CLA 2012-04-17 16:38:43 EDT
See patch for fix. Labels are now stored for later generation, so that they are between the atline() and the conditional.

atline(); // for the label below
atline(); // for the FOR loop below
LABEL1:
for (...) {
}
Comment 5 Huang Ji Yong CLA 2012-06-29 02:17:46 EDT
[Verified in build]: 
0.8.1.v201206271108