From a7458df0a4835cbc74de56e55831e4f7417f353b Mon Sep 17 00:00:00 2001 From: Taus Date: Wed, 26 Nov 2025 22:13:21 +0000 Subject: [PATCH] Python: Appease the QLDoc checker --- python/ql/lib/LegacyPointsTo.qll | 1 + python/ql/lib/semmle/python/Exprs.qll | 1 + python/ql/lib/semmle/python/types/Exceptions.qll | 1 + 3 files changed, 3 insertions(+) diff --git a/python/ql/lib/LegacyPointsTo.qll b/python/ql/lib/LegacyPointsTo.qll index c5821f3d009..45f4a80e8d1 100644 --- a/python/ql/lib/LegacyPointsTo.qll +++ b/python/ql/lib/LegacyPointsTo.qll @@ -299,6 +299,7 @@ class ClassWithPointsTo extends Class { override string getAQlClass() { none() } } +/** Gets the `Object` corresponding to the immutable literal `l`. */ Object getLiteralObject(ImmutableLiteral l) { l instanceof IntegerLiteral and ( diff --git a/python/ql/lib/semmle/python/Exprs.qll b/python/ql/lib/semmle/python/Exprs.qll index 203e63f611f..c374863d684 100644 --- a/python/ql/lib/semmle/python/Exprs.qll +++ b/python/ql/lib/semmle/python/Exprs.qll @@ -565,6 +565,7 @@ class StringLiteral extends Str_, ImmutableLiteral { override string toString() { result = "StringLiteral" } } +/** Holds if `n` is a named constant (`True`, `False`, or `None`) with name `id`. */ predicate name_consts(Name_ n, string id) { exists(Variable v | py_variables(v, n) and id = v.getId() | id = "True" or id = "False" or id = "None" diff --git a/python/ql/lib/semmle/python/types/Exceptions.qll b/python/ql/lib/semmle/python/types/Exceptions.qll index dd9ee1703a6..ea2f20e67aa 100644 --- a/python/ql/lib/semmle/python/types/Exceptions.qll +++ b/python/ql/lib/semmle/python/types/Exceptions.qll @@ -368,6 +368,7 @@ predicate scope_raises_unknown(Scope s) { ) } +/** An extension of `ExceptFlowNode` that provides points-to related methods. */ class ExceptFlowNodeWithPointsTo extends ExceptFlowNode { private predicate handledObject_objectapi(Object obj, ClassObject cls, ControlFlowNode origin) { this.getType().(ControlFlowNodeWithPointsTo).refersTo(obj, cls, origin)