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

Fix uninitialized child nodes for conditional expressions #1720

Merged

Conversation

anilanar
Copy link
Contributor

@anilanar anilanar commented Nov 10, 2017

Fixes #1719.

Problem: Dead branch nodes of conditional expressions were not initialized. i.e. when condition test is known to be true, test node is not initialized.
Fix: Initialize all children of conditional expressions similar to how it's done for if statements.
Test: Check unit test, it fails before this fix.

Another approach would be to remove pruned nodes in logical expressions. E.g. true || foo() would be pruned to true, false && foo() would be pruned to false.

@lukastaegert
Copy link
Member

Good catch + great PR 🎉 Thanks!

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

Successfully merging this pull request may close these issues.

Conditional expressions break when evaluating constant expressions
2 participants