Stratego/XT JIRA  History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: STR-528
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Bogdan Dumitriu
Reporter: Bogdan Dumitriu
Votes: 0
Watchers: 0
Operations

Clone this issue
Create sub-task
If you were logged in you would be able to see more operations.
Stratego/XT

dynamic rule intersection inside a fix point operator sometimes goes wrong

Created: 2006-03-02 17:11   Updated: 2008-03-31 20:39
Component/s: stratego-lib - Stratego Library
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
Running constant propagation on this Java code:

public class Foo
{
public void foo()
{
int x = 10;

while (something())
{
x = 5;
if (cond())
{
x = 10;
}
else
{}

call(x);
}
}
}

should not propagate x = 5 in the call(x) inside the while, but it does. However, changing the assignment x = 10 in the if (cond()) to x = 1 (or anything other than 10 for that matter) makes constant propagation behave correctly again.

 All   Comments   Work Log   Change History      Sort Order:
Bogdan Dumitriu [2006-03-07 14:17]
This has the same root cause as STR-511. Both set- and add-in-rule-scope do not work properly in all cases when multiple change sets are created.

Bogdan Dumitriu [2006-04-27 13:09]
Easier code to generate the same problem:

int x = 0;

if (cond()) {
  x = 1;
  if (cond()) {
    x = 0;
    f(x);
  }
}

x = 1 will be propagated in f(x).