File tree Expand file tree Collapse file tree 5 files changed +65
-0
lines changed
cpp/ql/src/semmle/code/cpp/ir/implementation
csharp/ql/src/experimental/ir/implementation Expand file tree Collapse file tree 5 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
1645
1645
* Gets the number of arguments of the call, including the `this` pointer, if any.
1646
1646
*/
1647
1647
final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648
+
1649
+ /**
1650
+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651
+ * `index` is `-1`.
1652
+ *
1653
+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654
+ * pathological join orders in case the argument index should get joined first.
1655
+ */
1656
+ pragma [ noinline]
1657
+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658
+ this = result .getPrimaryInstruction ( ) and
1659
+ index = result .( IndexedInstruction ) .getIndex ( )
1660
+ }
1648
1661
}
1649
1662
1650
1663
/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
1645
1645
* Gets the number of arguments of the call, including the `this` pointer, if any.
1646
1646
*/
1647
1647
final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648
+
1649
+ /**
1650
+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651
+ * `index` is `-1`.
1652
+ *
1653
+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654
+ * pathological join orders in case the argument index should get joined first.
1655
+ */
1656
+ pragma [ noinline]
1657
+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658
+ this = result .getPrimaryInstruction ( ) and
1659
+ index = result .( IndexedInstruction ) .getIndex ( )
1660
+ }
1648
1661
}
1649
1662
1650
1663
/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
1645
1645
* Gets the number of arguments of the call, including the `this` pointer, if any.
1646
1646
*/
1647
1647
final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648
+
1649
+ /**
1650
+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651
+ * `index` is `-1`.
1652
+ *
1653
+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654
+ * pathological join orders in case the argument index should get joined first.
1655
+ */
1656
+ pragma [ noinline]
1657
+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658
+ this = result .getPrimaryInstruction ( ) and
1659
+ index = result .( IndexedInstruction ) .getIndex ( )
1660
+ }
1648
1661
}
1649
1662
1650
1663
/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
1645
1645
* Gets the number of arguments of the call, including the `this` pointer, if any.
1646
1646
*/
1647
1647
final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648
+
1649
+ /**
1650
+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651
+ * `index` is `-1`.
1652
+ *
1653
+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654
+ * pathological join orders in case the argument index should get joined first.
1655
+ */
1656
+ pragma [ noinline]
1657
+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658
+ this = result .getPrimaryInstruction ( ) and
1659
+ index = result .( IndexedInstruction ) .getIndex ( )
1660
+ }
1648
1661
}
1649
1662
1650
1663
/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
1645
1645
* Gets the number of arguments of the call, including the `this` pointer, if any.
1646
1646
*/
1647
1647
final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648
+
1649
+ /**
1650
+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651
+ * `index` is `-1`.
1652
+ *
1653
+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654
+ * pathological join orders in case the argument index should get joined first.
1655
+ */
1656
+ pragma [ noinline]
1657
+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658
+ this = result .getPrimaryInstruction ( ) and
1659
+ index = result .( IndexedInstruction ) .getIndex ( )
1660
+ }
1648
1661
}
1649
1662
1650
1663
/**
You can’t perform that action at this time.
0 commit comments