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

Conditional stack is not popped for simple conditionals: rare unexpected behavior with conditional templates #34

Closed
UnexomWid opened this issue Dec 8, 2020 · 2 comments
Assignees
Labels
bug Something isn't working fixed The reported problem was fixed

Comments

@UnexomWid
Copy link
Owner

When there is a conditional template and the expression evaluates to false, the renderer jumps over the end template, resulting in the conditional stack not popping. This leads to very rare unexpected behavior that is very hard to predict. For example, in some cases, the renderer enters an else conditional template even if the previous conditional is true. This happens because the renderer retrieves information from another conditional template info structure, which was not popped and reports that the last conditional was false (thus resulting in the else conditional being rendered).

The problem is that the compiler emits the jump index after the end template, when it should emit it right before (such that the pop operation occurs).

@UnexomWid UnexomWid added the bug Something isn't working label Dec 8, 2020
@UnexomWid UnexomWid self-assigned this Dec 8, 2020
@UnexomWid UnexomWid added the fixed The reported problem was fixed label Dec 8, 2020
@pebly
Copy link
Contributor

pebly commented Dec 8, 2020

🔥

1 similar comment
@AndrewIGD
Copy link

🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed The reported problem was fixed
Projects
None yet
Development

No branches or pull requests

3 participants