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 #1557
Fixes #1253
Fixes #691
The program builder now ignores duplicate label errors for default user functions (labels that end in "-default"). In this instance, an already existing default function exists, and that instruction pointer is used instead of the new function.
A side effect of the previous logic was also that creating a new lock in a new program would redefine the lock's instruction pointer to refer to the default value. That means that an already existing lock object would no longer be evaluated. To fix this, we check to see if the lock's pointer is already defined. If it is defined, we know that it either points to the existing default function or to the existing lock function. In either case, we can skip setting the pointer to the default function.
Features:
Question:
Should we also not throw an exception if a label matches the function's hash? I believe that the hash now includes the file name, in which case the hashes will not match if two files simply define an identical lock, unless the hash of their file names is an exact match as well.