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

simple boolean condition in if-else branch should also create a dummy conditional-statements #86

Open
swang203 opened this issue Apr 6, 2020 · 0 comments
Assignees

Comments

@swang203
Copy link
Contributor

swang203 commented Apr 6, 2020

Current CFG doesn't generate a conditional-statements for the following source code.
Should do it or the back-end has no way to figure it out.
if (cond) {
x = 1
}

if (true) {
x = 2
}

------------generated cfg------------
1 0 0 SEQ0 2 1 0 0 21 if cond 4 2 0 SEQ1 5 4 0 14 19 = x 0d1 6 1 1 23 44 if true 8 6 0 SEQ2 9 8 0 37 42 = x 0d2

------ should be ------------
1 0 0 SEQ0 2 1 0 0 21 if cond 3 2 0 SEQ1 4 3 0 == cond true 5 2 0 SEQ2 6 4 0 14 19 = x 0d1 7 1 1 23 44 if true 8 7 0 SEQ3 9 8 0 == true true 10 7 0 SEQ4 11 10 0 37 42 = x 0d2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants