Skip to content

Commit 3ba256a

Browse files
committed
C#/Java: Go back to access path limit 2
1 parent 666855d commit 3ba256a

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ module SummaryModelGeneratorInput implements SummaryModelGeneratorInputSig {
260260
)
261261
}
262262

263+
int contentAccessPathLimitInternal() { result = 2 }
264+
263265
bindingset[d]
264266
private string getFullyQualifiedName(Declaration d) {
265267
exists(string qualifier, string name |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ module SummaryModelGeneratorInput implements SummaryModelGeneratorInputSig {
218218
)
219219
}
220220

221+
int contentAccessPathLimitInternal() { result = 2 }
222+
221223
predicate isField(DataFlow::ContentSet c) {
222224
c instanceof DataFlowUtil::FieldContent or
223225
c instanceof DataFlowUtil::SyntheticFieldContent

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,16 @@ module MakeModelGeneratorFactory<
277277
*/
278278
predicate isAdditionalContentFlowStep(Lang::Node nodeFrom, Lang::Node nodeTo);
279279

280+
/**
281+
* Gets the access path limit for content flow analysis.
282+
*/
283+
default int contentAccessPathLimit() { result = 2 }
284+
285+
/**
286+
* Gets the internal access path limit for content flow analysis.
287+
*/
288+
default int contentAccessPathLimitInternal() { result = Lang::accessPathLimit() }
289+
280290
/**
281291
* Holds if the content set `c` is field like.
282292
*/
@@ -650,7 +660,10 @@ module MakeModelGeneratorFactory<
650660
exists(Type t | t = n.(NodeExtended).getType() and not isRelevantType(t))
651661
}
652662

653-
int accessPathLimit() { result = 2 }
663+
predicate accessPathLimit = SummaryModelGeneratorInput::contentAccessPathLimit/0;
664+
665+
predicate accessPathLimitInternal =
666+
SummaryModelGeneratorInput::contentAccessPathLimitInternal/0;
654667

655668
predicate isRelevantContent(DataFlow::ContentSet s) { isRelevantContent0(s) }
656669

0 commit comments

Comments
 (0)