File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/analysis Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,14 @@ module Make<ParamSig Param> {
5454
5555 bindingset [ this , reason]
5656 override SemReason combineWith ( SemReason reason ) {
57+ // Since we end up reporting a `SemReason` for the inferred bound we often pick somewhat
58+ // arbitrarily between two `SemReason`s during the analysis. This isn't an issue for most reasons
59+ // since they're mainly used for constructing alert messages. However, the `SemTypeReason` is
60+ // supposed to be used in query logic to filter out bounds inferred by type-based analysis if
61+ // the query author chooses to do so. So we need to ensure that if _any_ of the bounds that
62+ // contribute to the final bound depends on type information then the `SemReason` we report must
63+ // be a `SemTypeReason`. So when we need to combine this `SemCondReason` with a `SemTypeReason`
64+ // the result should always be a `SemTypeReason`.
5765 if reason instanceof SemTypeReason then result instanceof SemTypeReason else result = this
5866 }
5967 }
You can’t perform that action at this time.
0 commit comments