Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with "decrementing for loops" #103

Closed
peterwvj opened this issue Jun 12, 2017 · 0 comments
Closed

Issue with "decrementing for loops" #103

peterwvj opened this issue Jun 12, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@peterwvj
Copy link
Member

peterwvj commented Jun 12, 2017

The code-generator wrongly assumes that all for loops increment their loop counter. This issue can be demonstrated using the following model:

class A

operations

public op : () ==> nat
op () ==
(
  dcl c : nat := 10;
	for i = 10 to 5 by -1 do
	  c := c - 1;
	
	return c;
);

end A

To clarify, new A().op() returns 4 as expected, whereas the equivalent C expressions returns 10.

@peterwvj peterwvj added the bug label Jun 12, 2017
@peterwvj peterwvj added this to the v0.1.8 milestone Jun 12, 2017
@peterwvj peterwvj self-assigned this Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant