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

check and fix If clause of translateStatement #339

Open
4 tasks
ivoysey opened this issue May 26, 2021 · 0 comments
Open
4 tasks

check and fix If clause of translateStatement #339

ivoysey opened this issue May 26, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@ivoysey
Copy link
Collaborator

ivoysey commented May 26, 2021

There are two todos in codegen that mark a site of a likely bug. I think that there isn't an assignment back to the temporary variable at the very end of the code we generate, which means that the value gets computed but then dropped on the floor. This bug existed in IfThenElse as well, and I fixed it there, but I didn't look at these two sites closely enough to make a test that breaks and know for sure:

https://github.com/mcoblenz/Obsidian/blob/test_output/src/main/scala/edu/cmu/cs/obsidian/codegen/CodeGenYul.scala#L319

https://github.com/mcoblenz/Obsidian/blob/test_output/src/main/scala/edu/cmu/cs/obsidian/codegen/CodeGenYul.scala#L325

  • try to write at test that breaks the output
  • fix it in an analogous way to IfThenElse if it is indeed broken
  • look for other cases that have the same bug still
  • write a helper function that has the right pattern in it once and for all and use that instead of doing it by hand in each case.
@ivoysey ivoysey added the bug label May 26, 2021
@ivoysey ivoysey self-assigned this May 26, 2021
@ivoysey ivoysey added this to the m1 milestone May 27, 2021
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