From 261ba8e02d9ebe13fb9a0bc0d495d916df84efd4 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Wed, 30 Aug 2023 14:34:30 +0100 Subject: [PATCH] C++: Add QLDoc to 'isDereference'. --- .../code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll index 218d6562565..27948d68913 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll @@ -320,6 +320,14 @@ private module IteratorIndirections { } } +/** + * Holds if `deref` is the result of loading the value at the address + * represented by `address`. + * + * If `additional = true` then the dereference comes from an `Indirection` + * class (such as a call to an iterator's `operator*`), and if + * `additional = false` the dereference is a `LoadInstruction`. + */ predicate isDereference(Instruction deref, Operand address, boolean additional) { any(Indirection ind).isAdditionalDereference(deref, address) and additional = true