NPE in TaintedArrayGene - #1777
Merged
arcuri82 merged 2 commits intoSep 22, 2026
Merged
Conversation
jgaleotti
approved these changes
Sep 18, 2026
arcuri82
requested changes
Sep 21, 2026
| Resolving a taint adds the array as a child, so a resolved and an unresolved gene do not | ||
| have the same structure, and copying a value cannot turn one into the other | ||
| */ | ||
| if(this.isResolved() != other.isResolved()){ |
Collaborator
There was a problem hiding this comment.
rather than returning false, should handle this case. eg, this.arrayGene could be put to null or created, and taintedValue could be copied
arcuri82
approved these changes
Sep 22, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#1729 adds a new gene class for CQL's duration data type
After merging master into that branch, test case with seed 1384 in class GeneRandomizedTest began to fail due to a NPE in TaintedArrayGene's unsafeCopyValueFrom implementation, more specifically in
return this.arrayGene?.unsafeCopyValueFrom(other.arrayGene!!) ?: truedue to other.arrayGene being null.
Copying from an unresolved gene into a resolved one threw a NullPointerException, and the opposite direction reported a successful copy without copying anything. This PR suggests returning false for both scenarios.
TaintedArrayGeneTest.testChoiceCopiesIntoTheAlternativeInTheSameState() represents the scenario for seed 1384 (for the current list of available gene classes) from which the NPE originated.