Skip to content

Commit 80497f5

Browse files
committed
Shared: Only make unlifted models in case the API itself is relevant.
1 parent 3d1a403 commit 80497f5

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ module ModelGeneratorInput implements ModelGeneratorInputSig<Location, CsharpDat
131131

132132
Callable lift() { result = lift }
133133

134-
predicate isRelevant() { relevant(this) }
134+
predicate isRelevant() {
135+
relevant(this) and
136+
not hasManualSummaryModel(this)
137+
}
135138
}
136139

137140
/**

java/ql/src/utils/modelgenerator/internal/CaptureModels.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ module ModelGeneratorInput implements ModelGeneratorInputSig<Location, JavaDataF
110110

111111
Callable lift() { result = lift }
112112

113-
predicate isRelevant() { relevant(this) }
113+
predicate isRelevant() {
114+
relevant(this) and
115+
not hasManualSummaryModel(this)
116+
}
114117
}
115118

116119
private string isExtensible(Callable c) {

shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,11 @@ module MakeModelGenerator<
848848
input = parameterNodeAsContentInput(p) + printReadAccessPath(reads) and
849849
output = getContentOutput(returnNodeExt) + printStoreAccessPath(stores) and
850850
input != output and
851-
(if mentionsField(reads) or mentionsField(stores) then lift = false else lift = true)
851+
(
852+
if mentionsField(reads) or mentionsField(stores)
853+
then lift = false and api.isRelevant()
854+
else lift = true
855+
)
852856
)
853857
}
854858

0 commit comments

Comments
 (0)