Mathias Vorreiter Pedersen
89eaadd76f
C++: Move destructor calls from expressions with a temporary object conversion to the temporary object conversion.
2024-04-07 15:48:38 +01:00
Mathias Vorreiter Pedersen
54e4103e71
C++: Fix another multiple parents problem.
2024-04-05 18:07:53 +01:00
Mathias Vorreiter Pedersen
f1d2dac648
C++: Fix a bug where the destructor attached to a 'new' expression would
...
have multiple parents (the 'new' expression, the call to 'operator new',
and the size expression). This happens because the latter two are
'TranslatedExpr's that return the 'new' expression as their expression
even though they don't technically represent the translation of this
expression.
To prevent this bug we tell the IR construction that the latter two
handle their destructors explicitly which means that IR construction
doesn't try to synthesize them.
2024-04-05 14:46:27 +01:00
Mathias Vorreiter Pedersen
d279e3f17a
C++: Suppress destructor calls for the right-hand side of logical operations since these are also conditional.
2024-04-05 09:47:11 +01:00
Mathias Vorreiter Pedersen
f098b8eb82
C++: Make sure the edge kind out of a throw is an 'ExceptionEdge' even if destructors are called.
2024-04-04 20:01:52 +01:00
Mathias Vorreiter Pedersen
180888616b
C++: Properly handle the case where a TranslatedElement has no children.
2024-04-04 16:02:01 +01:00
Mathias Vorreiter Pedersen
73602dca92
C++: Also suppress destructor calls on throwing ternary expressions.
2024-04-04 14:51:11 +01:00
Mathias Vorreiter Pedersen
796fcfec6c
C++: Handle conversions in 'isInConditionalEvaluation'.
2024-04-04 14:44:16 +01:00
Mathias Vorreiter Pedersen
a756f14e77
C++: Only report implicit destructors if we need to translate them.
2024-04-04 14:41:23 +01:00
Robert Marsh
17e8c95e7f
C++: suppress destructors on conditional temporaries
2024-04-04 11:28:10 +01:00
Robert Marsh
75c453fd30
C++: Unsuppress temporary destructors in IR
2024-04-04 10:29:59 +01:00
Tom Hvitved
1dc13cc169
Merge pull request #15923 from hvitved/shared-xml-impl
...
Properly shared `XML.qll` implementation
2024-04-03 11:39:50 +02:00
Jeroen Ketema
01183800a6
C++: Fix formatting
2024-04-02 11:38:19 +02:00
Jeroen Ketema
9190bf25ce
C++: Add example to QLDoc
2024-04-02 11:35:43 +02:00
Jeroen Ketema
a5d4fad806
C++: Output destructor calls for delete expressions
2024-04-02 10:32:03 +02:00
Jeroen Ketema
9eb51a9b9e
C++: Add value category column to the expr_reuse relation
2024-03-27 22:49:40 +01:00
Mathias Vorreiter Pedersen
7bb2b57394
Merge pull request #15964 from rdmarsh2/rdmarsh2/cpp/temp-destructors-extended
...
C++: IR translation for destruction of temporaries with extended lifetimes
2024-03-27 11:58:48 +00:00
Jeroen Ketema
27c6e2421c
C++: Add VariableTemplateInstantiation class
...
This adds some uniformity, as we already had `FunctionTemplateInstantiation` and
`ClassTemplateInstantiation` classes.
2024-03-27 11:35:13 +01:00
Mathias Vorreiter Pedersen
3bfaab9182
C++: Remove debugging conjunct.
2024-03-26 17:01:06 +00:00
Mathias Vorreiter Pedersen
6a8c592900
Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/FlowSteps.qll
...
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com >
2024-03-26 16:59:18 +00:00
Mathias Vorreiter Pedersen
d610d721a4
C++: Add file QLDoc.
2024-03-26 16:47:39 +00:00
Mathias Vorreiter Pedersen
2075716df7
C++: Add 'TaintInheritingContent'.
2024-03-26 16:37:22 +00:00
Jeroen Ketema
a3ae304dfe
C++: Handle getInitializingExpr in PrintAST
2024-03-21 11:32:23 +01:00
Mathias Vorreiter Pedersen
7ff2998c88
Merge pull request #15980 from MathiasVP/guards-lt
...
C++: Support `<` reasoning for `switch` statements in Guards library
2024-03-20 10:40:39 +00:00
Mathias Vorreiter Pedersen
3a7b80da47
C++: Respond to review comments.
2024-03-20 10:12:29 +00:00
Mathias Vorreiter Pedersen
9179f0bda6
Merge pull request #15969 from MathiasVP/disable-some-constant-folding
...
C++: Disable _some_ constant folding in IR
2024-03-20 09:25:06 +00:00
Mathias Vorreiter Pedersen
a78080cc0e
C++: Implement less-than logic for guard conditions when comparing to constants.
2024-03-19 17:06:26 +00:00
Mathias Vorreiter Pedersen
8b85735cdc
C++: Generalize predicates from booleans to abstract values.
2024-03-19 17:03:59 +00:00
Mathias Vorreiter Pedersen
6bf1611f10
C++: Fix comments.
2024-03-19 16:26:37 +00:00
Mathias Vorreiter Pedersen
357a2ba733
C++: Sync identical files.
2024-03-19 16:24:11 +00:00
Mathias Vorreiter Pedersen
458ee13345
C++: Add constant analysis for bitwise operations now that these are no longer constant folded by IR construction.
2024-03-19 16:23:57 +00:00
Robert Marsh
5a30ad162a
C++: Add a comment for ReusedExpr IR translation
2024-03-19 15:54:52 +00:00
Robert Marsh
3d4f7d880d
C++: unsuppress destructoion of temporaries with extended lifetimes
2024-03-19 15:54:42 +00:00
Robert Marsh
ba10ea8121
C++: ReuseExpr IR translation
2024-03-19 15:50:28 +00:00
Mathias Vorreiter Pedersen
6ce3f35ef5
C++: Fix API for guards.
2024-03-19 14:43:10 +00:00
Mathias Vorreiter Pedersen
597f0082e7
Merge pull request #15958 from MathiasVP/ir-guards-from-switch-statements-2
...
C++: Implement guards logic for switch statements
2024-03-19 13:21:45 +00:00
Mathias Vorreiter Pedersen
a88d8b260d
C++: Only ignore constant folding for certain binary operations.
2024-03-19 13:17:49 +00:00
Mathias Vorreiter Pedersen
a97891cbc1
C++: Add QLDoc to 'getNumberOfBinaryOperands' (and rename it to 'getNumberOfNestedBinaryOperands').
2024-03-19 12:56:15 +00:00
Tom Hvitved
754b491d09
C++: Switch to shared XML.qll implementation
2024-03-19 13:14:42 +01:00
Mathias Vorreiter Pedersen
4d3076ae7e
C++: Don't constant fold small binary operations.
2024-03-19 11:46:51 +00:00
Mathias Vorreiter Pedersen
350b239ed6
C++: Fix cartesian product in 'simple_comparison_eq'.
2024-03-19 10:29:43 +00:00
Tom Hvitved
fc55567d90
Merge pull request #15853 from hvitved/dataflow/get-location
...
Data flow: Replace `hasLocationInfo` with `getLocation`
2024-03-18 20:21:46 +01:00
Mathias Vorreiter Pedersen
dbd47b387a
C++: Add AST wrappers for the new predicates.
2024-03-18 16:26:36 +00:00
Mathias Vorreiter Pedersen
44045d3eed
C++: Add guards logic for constant comparisons.
2024-03-18 16:07:57 +00:00
Mathias Vorreiter Pedersen
a21eea4ee0
C++: Generalize more predicates from booleans to abstract values.
2024-03-18 16:07:57 +00:00
Mathias Vorreiter Pedersen
575af1a5f9
Merge branch 'main' into experimental-surprising-lifetimes-for-range-based-for-loop
2024-03-18 11:11:32 +00:00
Mathias Vorreiter Pedersen
1d12e0c9d9
Merge pull request #15941 from MathiasVP/ir-guards-from-switch-statements
...
C++: Handle `switch` statements in the guards library
2024-03-18 11:07:10 +00:00
Mathias Vorreiter Pedersen
f4f417c3f9
C++: Fix QLoc.
2024-03-15 17:19:36 +00:00
Mathias Vorreiter Pedersen
34decd3cf1
C++: Add more general public predicates to work with abstract values.
2024-03-15 17:03:45 +00:00
Mathias Vorreiter Pedersen
f4eb5f5a2d
C++: Convert 'getBranchSuccessor' to use abstract values.
2024-03-15 17:03:45 +00:00