File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1066,6 +1066,10 @@ private module GetConvertedResultExpression {
1066
1066
private import semmle.code.cpp.ir.implementation.raw.internal.TranslatedExpr
1067
1067
private import semmle.code.cpp.ir.implementation.raw.internal.InstructionTag
1068
1068
1069
+ private Operand getAnInitializeDynamicAllocationInstructionAddress ( ) {
1070
+ result = any ( InitializeDynamicAllocationInstruction init ) .getAllocationAddressOperand ( )
1071
+ }
1072
+
1069
1073
/**
1070
1074
* Gets the expression that should be returned as the result expression from `instr`.
1071
1075
*
@@ -1074,7 +1078,16 @@ private module GetConvertedResultExpression {
1074
1078
*/
1075
1079
Expr getConvertedResultExpression ( Instruction instr , int n ) {
1076
1080
// Only fully converted instructions has a result for `asConvertedExpr`
1077
- not conversionFlow ( unique( | | getAUse ( instr ) ) , _, false , false ) and
1081
+ not conversionFlow ( unique( Operand op |
1082
+ // The address operand of a `InitializeDynamicAllocationInstruction` is
1083
+ // special: we need to handle it during dataflow (since it's
1084
+ // effectively a store to an indirection), but it doesn't appear in
1085
+ // source syntax, so dataflow node <-> expression conversion shouldn't
1086
+ // care about it.
1087
+ op = getAUse ( instr ) and not op = getAnInitializeDynamicAllocationInstructionAddress ( )
1088
+ |
1089
+ op
1090
+ ) , _, false , false ) and
1078
1091
result = getConvertedResultExpressionImpl ( instr ) and
1079
1092
n = 0
1080
1093
or
You can’t perform that action at this time.
0 commit comments