You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a weird one! Basically, when compiling IR, Dialog tries to use as few temporary registers as possible. As part of this, it keeps an array called known_args that holds the known values of all the argument registers. If it needs to load a constant into a register, and one of the known_args already holds that constant, it uses that argument register instead of a new temporary.
Except in a certain edge case, the value of the argument register could change, but the slot in known_args would not be updated. For example:
(test 1)
(show [[1] [2]])
When (test $) is called, its argument 1 is put into argument register A0, and it needs to put the list [[1] [2]] into A0 for the (show $) call. As it's building that list, known_args for A0 still has the value 1, so it tries to use that to construct the list. But A0 has already been overwritten by [2], so it ends up constructing [[[2]] [2]] instead.
This PR fixes the problem by updating the known_args in that edge case: putting in a new value if it's a compile-time constant, or just setting it to NULL if it's not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #204
See there for explanation