Commit Graph

2511 Commits

Author SHA1 Message Date
idrissrio
e31f722d76 C++: Add support for getting referenced literals in using declarations 2025-06-03 16:04:30 +02:00
Jeroen Ketema
b071a462f3 Merge pull request #19563 from jketema/jketema/win-flow
C++: Add Windows command line and environment models
2025-05-27 12:32:51 +02:00
Anders Schack-Mulligen
a519eabd4d Merge pull request #19571 from aschackmull/rangeanalysis/guards
Rangeanalysis: Simplify Guards integration.
2025-05-26 10:36:22 +02:00
Jeroen Ketema
a77ddd7532 C++: Add Windows command line and environment models 2025-05-23 15:56:09 +02:00
Mathias Vorreiter Pedersen
0822ded899 Merge pull request #19569 from MathiasVP/fix-return-value-surces-in-mad
Shared/C++: Handle non-standard return values in MaD flow sources/sinks
2025-05-23 13:58:26 +01:00
Anders Schack-Mulligen
62000319fe Rangeanalysis: Simplify Guards integration. 2025-05-23 13:39:53 +02:00
Mathias Vorreiter Pedersen
07c4eca4d8 C++: Implement the new predicate for C++. 2025-05-23 11:16:49 +01:00
Anders Schack-Mulligen
1d30103559 SSA: Distinguish between has and controls branch edge. 2025-05-23 09:56:22 +02:00
Anders Schack-Mulligen
db01828717 Java: Deprecate redundant basic block predicates. 2025-05-21 09:01:46 +02:00
Jeroen Ketema
dfbe08d14c Merge pull request #19518 from jketema/depr
C++/Swift: delete outdated deprecations
2025-05-19 14:39:13 +02:00
Mathias Vorreiter Pedersen
adb74105fd Merge pull request #19511 from MathiasVP/as-expr-array-aggregate-literal
C++: Make `node.asExpr() instanceof ArrayAggregateLiteral` satisfiable
2025-05-19 12:47:28 +01:00
Napalys Klicius
703aec1990 cpp: removed now unused predicate commandLineArg 2025-05-19 13:27:26 +02:00
Napalys Klicius
c74321a2ee all: used Erik's script to delete outdated deprecations 2025-05-19 13:26:08 +02:00
Mathias Vorreiter Pedersen
8e005a65bf C++: Fix missing 'asExpr' for array aggregate literals. 2025-05-16 20:12:58 +01:00
Mathew Payne
bbce0d0c65 Update cpp/ql/lib/semmle/code/cpp/security/FlowSources.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2025-05-16 18:55:00 +01:00
Mathew Payne
c79a724f5d feat(cpp): Update FlowSources to add wmain 2025-05-16 18:21:44 +01:00
Mathias Vorreiter Pedersen
03d6633d41 Merge pull request #19501 from MathiasVP/as-expr-class-aggregate-literal
C++: Make `node.asExpr() instanceof ClassAggregateLiteral` satisfiable
2025-05-16 13:49:03 +01:00
Mathias Vorreiter Pedersen
e11ab0f125 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/ExprNodes.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-16 12:06:25 +01:00
Mathias Vorreiter Pedersen
d31ddad832 C++: Small refactoring. 2025-05-15 18:04:57 +01:00
Mathias Vorreiter Pedersen
783560cff6 C++: Add a subclass of PostUpdateNodes and ensure that 'node.asExpr() instanceof ClassAggregateLiteral' holds for this new node subclass. 2025-05-15 17:23:32 +01:00
Mathias Vorreiter Pedersen
69a1a87aa4 C++: Update semantics of picking the static call target in dataflow. 2025-05-15 15:25:29 +01:00
Jeroen Ketema
401281331f C++: Fix IR edge case where there are no function calls taking an argument 2025-05-14 13:44:29 +02:00
Mathias Vorreiter Pedersen
f255fc2fd5 C++: Drive-by join order fix. Before:
```
Evaluated relational algebra for predicate SsaInternals::getDefImpl/1#1ed4f567@65628fbv with tuple counts:
          4935102  ~5%    {4} r1 = SCAN `SsaInternals::SsaImpl::Definition.definesAt/3#dispred#7eea4c8f` OUTPUT In.2, In.3, In.0, In.1
        104274503  ~1%    {3}    | JOIN WITH `SsaInternals::DefImpl.hasIndexInBlock/2#dispred#30a6c29f_120#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.3, Lhs.2
          4921319  ~2%    {2}    | JOIN WITH `SsaInternals::DefImpl.getSourceVariable/0#dispred#72437659` ON FIRST 2 OUTPUT Lhs.2, Lhs.0
                          return r1
```
After:
```
Evaluated relational algebra for predicate SsaInternals::SsaImpl::Definition.definesAt/3#dispred#7eea4c8f_1230#join_rhs@b280fb5h with tuple counts:
        4935102  ~3%    {4} r1 = SCAN `SsaInternals::SsaImpl::Definition.definesAt/3#dispred#7eea4c8f` OUTPUT In.1, In.2, In.3, In.0
                        return r1

Evaluated relational algebra for predicate SsaInternals::DefImpl.hasIndexInBlock/3#dispred#31d295aa_1230#join_rhs@2be655s4 with tuple counts:
        5634706  ~1%    {4} r1 = SCAN `SsaInternals::DefImpl.hasIndexInBlock/3#dispred#31d295aa` OUTPUT In.1, In.2, In.3, In.0
                        return r1

Evaluated relational algebra for predicate SsaInternals::getDefImpl/1#1ed4f567@8afa36uu with tuple counts:
        4921319  ~2%    {2} r1 = JOIN `SsaInternals::SsaImpl::Definition.definesAt/3#dispred#7eea4c8f_1230#join_rhs` WITH `SsaInternals::DefImpl.hasIndexInBlock/3#dispred#31d295aa_1230#join_rhs` ON FIRST 3 OUTPUT Lhs.3, Rhs.3
                        return r1
```
2025-05-13 14:21:28 +01:00
Mathias Vorreiter Pedersen
0836f0b413 C++: Cache and fix join order in 'hasIncompleteSsa'. 2025-05-13 13:41:15 +01:00
Mathias Vorreiter Pedersen
9d2eb3d9b8 C++: Filter out instructions with incomplete SSA in range analysis. 2025-05-13 10:54:22 +01:00
Mathias Vorreiter Pedersen
510df38da2 C++: Add an 'hasIncompleteSsa' predicate to check whether a function has correctly modelled SSA information. 2025-05-13 10:54:20 +01:00
Mathias Vorreiter Pedersen
f1b4e05579 C++: Expose 'isBusyDef'. 2025-05-12 19:45:19 +01:00
Mathias Vorreiter Pedersen
e51cb478af C++: Expose 'MemoryLocation0'. 2025-05-12 19:43:19 +01:00
Jeroen Ketema
9396f0ee55 C++: Set defaultFieldFlowBranchLimit to 3 2025-04-25 13:10:42 +02:00
Jeroen Ketema
ac3c3ae13a C++: Do not limit second level scopes to the top-level 2025-04-25 13:10:40 +02:00
Jeroen Ketema
df3282c204 C++: Support C23 typeof and typeof_unqual 2025-04-23 16:56:47 +02:00
Jeroen Ketema
0bcee84117 C++: Minor textual fixes 2025-04-17 12:33:27 +02:00
idrissrio
49183bb82a C++: add predicate to distinguish between array/field designators 2025-04-16 16:19:26 +02:00
idrissrio
033bade0ab C++: add isVLA() to ArrayType to identify variable-length arrays 2025-04-15 11:03:26 +02:00
Mathias Vorreiter Pedersen
deef95d384 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll
Co-authored-by: Taus <tausbn@github.com>
2025-04-11 12:43:59 +01:00
Mathias Vorreiter Pedersen
bfc494c0e1 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll
Co-authored-by: Taus <tausbn@github.com>
2025-04-11 12:43:51 +01:00
Mathias Vorreiter Pedersen
3bb249f580 C++: Ensure we always have 'Position's even if there are no calls in the DB. 2025-04-10 14:28:40 +01:00
Mathias Vorreiter Pedersen
b678112f4d C++: Add a few predicates to 'ReturnKind'. 2025-04-10 14:28:38 +01:00
Mathias Vorreiter Pedersen
960e9900af C++: Move the 'getArgumentIndex' into the abstract 'Position' class. It is implemented in all subclasses anyway. 2025-04-10 14:28:36 +01:00
Mathias Vorreiter Pedersen
94e08e318d C++: Expose a few predicates from 'ExternalFlow'. 2025-04-10 14:18:47 +01:00
Idriss Riouak
1ebce01c95 Merge pull request #19159 from github/idrissrio/calling-conventions
C++: Add class representing calling conventions
2025-04-01 10:31:16 +02:00
idrissrio
f83f14bab2 C++: add calling convention specifier class 2025-03-31 17:44:56 +02:00
Anders Schack-Mulligen
a6a694dec6 C++: Use DataFlowIntegration in IteratorFlow. 2025-03-31 10:49:43 +02:00
Anders Schack-Mulligen
aaa7e4cf95 C++: Def is only used in defToNode, which doesn't include phi reads nodes. 2025-03-31 10:49:43 +02:00
Anders Schack-Mulligen
133f08784f C++: Eliminate dead code, uncertain is always false. 2025-03-31 10:49:42 +02:00
Anders Schack-Mulligen
5a986f5327 SSA: Remove empty predicates and dead code. 2025-03-28 12:00:38 +01:00
Anders Schack-Mulligen
308d15401f C++: Add ssaDefHasSource. 2025-03-28 11:57:30 +01:00
Anders Schack-Mulligen
d5d0274ce7 Java/SSA: Keep proper distinction between cached stages. 2025-03-25 13:43:55 +01:00
Anders Schack-Mulligen
4d04391b70 C++: Keep all phi input back edges. 2025-03-25 13:21:13 +01:00
Mathias Vorreiter Pedersen
78697903fc C++: Move ATL models to ATL namespace. 2025-03-14 18:43:06 +00:00