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 {
10661066 private import semmle.code.cpp.ir.implementation.raw.internal.TranslatedExpr
10671067 private import semmle.code.cpp.ir.implementation.raw.internal.InstructionTag
10681068
1069+ private Operand getAnInitializeDynamicAllocationInstructionAddress ( ) {
1070+ result = any ( InitializeDynamicAllocationInstruction init ) .getAllocationAddressOperand ( )
1071+ }
1072+
10691073 /**
10701074 * Gets the expression that should be returned as the result expression from `instr`.
10711075 *
@@ -1074,7 +1078,16 @@ private module GetConvertedResultExpression {
10741078 */
10751079 Expr getConvertedResultExpression ( Instruction instr , int n ) {
10761080 // 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
10781091 result = getConvertedResultExpressionImpl ( instr ) and
10791092 n = 0
10801093 or
You can’t perform that action at this time.
0 commit comments