Map doesn't work without concrete #1228
Merged
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.
Description
At some moment we discovered that maps do not work as they suppose: sometimes concrete could fix it (for example, when a map was not a parameter), sometimes could not. This request fixes two particular problems: error in type indices for
select
operation and possible aliasing between nested arrays.A problem with aliasing could be seen while debugging org.utbot.examples.collections.Maps#putInMapFromParameters. Without this fix it doesn't work for an empty map:
touched
andvalues
might have the same address, and if we make twoput
operations, the second one will cause a problem -- memory update for keys will rewrite values as well, and we'll have wrong result values. With one put or with a map that was created during the execution everything worked fine (after the fix with types)Fixes #436
Type of Change
How Has This Been Tested?
Automated Testing
org.utbot.examples.collections.Maps#createMapWithEnum
org.utbot.examples.collections.Maps#createMapWithString
org.utbot.examples.collections.Maps#containsKeyAndPuts
org.utbot.examples.collections.Maps#putInMapFromParameters
org.utbot.examples.collections.Maps#mapPutAndGet
Manual Scenario
Didn't check manually.
Checklist: