Skip to content

Commit 6e6e118

Browse files
committed
C++: Make the branches more identical.
1 parent 58d8a2d commit 6e6e118

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,10 @@ private import ssa0.SsaInternals as SsaInternals0
1010
import SsaInternalsCommon
1111

1212
private module SourceVariables {
13-
int getMaxIndirectionForIRVariable(IRVariable var) {
14-
exists(Type type, boolean isGLValue |
15-
var.getLanguageType().hasType(type, isGLValue) and
16-
if isGLValue = true
17-
then result = 1 + getMaxIndirectionsForType(type)
18-
else result = getMaxIndirectionsForType(type)
19-
)
20-
}
21-
2213
cached
2314
private newtype TSourceVariable =
2415
TSourceIRVariable(BaseIRVariable baseVar, int ind) {
25-
ind = [0 .. getMaxIndirectionForIRVariable(baseVar.getIRVariable())]
16+
ind = [0 .. countIndirectionsForCppType(baseVar.getIRVariable().getLanguageType()) + 1]
2617
} or
2718
TCallVariable(AllocationInstruction call, int ind) {
2819
ind = [0 .. countIndirectionsForCppType(getResultLanguageType(call))]

0 commit comments

Comments
 (0)