[PATCH] D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers
Mandeep Singh Grang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 22 10:23:36 PDT 2019
mgrang added a comment.
In D59279#1439014 <https://reviews.llvm.org/D59279#1439014>, @Szelethus wrote:
> In D59279#1438514 <https://reviews.llvm.org/D59279#1438514>, @mgrang wrote:
>
> > Although, as you rightly pointed out that //ordered// sets of pointers are as non-deterministic as //unordered// ones.
>
>
> What if you store pointers to the elements of an array? In that case, it should be deterministic.
>
> -----------
> |1|2|3|5|6|
> -----------
> ^ ^
> p q
>
>
> In the above example, pointer `p`'s memory address will always be less then `q`'s, so in an ordered set, iterating over them would be deterministic. When hashing algorithms come into the picture, than it wouldn't be :^)
Yes, by //containers// here I mean //hashing containers//.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59279/new/
https://reviews.llvm.org/D59279
More information about the cfe-commits
mailing list