File tree Expand file tree Collapse file tree 5 files changed +40
-5
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 +40
-5
lines changed Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
1077
1077
final override string getImmediateString ( ) { result = elementSize .toString ( ) }
1078
1078
1079
1079
/**
1080
- * Gets the size of the element pointed to by the pointer, in bytes.
1080
+ * Gets the size of the elements pointed to by the pointer operands, in bytes.
1081
+ *
1082
+ * When adding an integer offset to a pointer (`PointerAddInstruction`) or subtracting an integer
1083
+ * offset from a pointer (`PointerSubInstruction`), the integer offset is multiplied by the
1084
+ * element size to compute the actual number of bytes added to or subtracted from the pointer
1085
+ * address. When computing the integer difference between two pointers (`PointerDiffInstruction`),
1086
+ * the result is computed by computing the difference between the two pointer byte addresses, then
1087
+ * dividing that byte count by the element size.
1081
1088
*/
1082
1089
final int getElementSize ( ) { result = elementSize }
1083
1090
}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
1077
1077
final override string getImmediateString ( ) { result = elementSize .toString ( ) }
1078
1078
1079
1079
/**
1080
- * Gets the size of the element pointed to by the pointer, in bytes.
1080
+ * Gets the size of the elements pointed to by the pointer operands, in bytes.
1081
+ *
1082
+ * When adding an integer offset to a pointer (`PointerAddInstruction`) or subtracting an integer
1083
+ * offset from a pointer (`PointerSubInstruction`), the integer offset is multiplied by the
1084
+ * element size to compute the actual number of bytes added to or subtracted from the pointer
1085
+ * address. When computing the integer difference between two pointers (`PointerDiffInstruction`),
1086
+ * the result is computed by computing the difference between the two pointer byte addresses, then
1087
+ * dividing that byte count by the element size.
1081
1088
*/
1082
1089
final int getElementSize ( ) { result = elementSize }
1083
1090
}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
1077
1077
final override string getImmediateString ( ) { result = elementSize .toString ( ) }
1078
1078
1079
1079
/**
1080
- * Gets the size of the element pointed to by the pointer, in bytes.
1080
+ * Gets the size of the elements pointed to by the pointer operands, in bytes.
1081
+ *
1082
+ * When adding an integer offset to a pointer (`PointerAddInstruction`) or subtracting an integer
1083
+ * offset from a pointer (`PointerSubInstruction`), the integer offset is multiplied by the
1084
+ * element size to compute the actual number of bytes added to or subtracted from the pointer
1085
+ * address. When computing the integer difference between two pointers (`PointerDiffInstruction`),
1086
+ * the result is computed by computing the difference between the two pointer byte addresses, then
1087
+ * dividing that byte count by the element size.
1081
1088
*/
1082
1089
final int getElementSize ( ) { result = elementSize }
1083
1090
}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
1077
1077
final override string getImmediateString ( ) { result = elementSize .toString ( ) }
1078
1078
1079
1079
/**
1080
- * Gets the size of the element pointed to by the pointer, in bytes.
1080
+ * Gets the size of the elements pointed to by the pointer operands, in bytes.
1081
+ *
1082
+ * When adding an integer offset to a pointer (`PointerAddInstruction`) or subtracting an integer
1083
+ * offset from a pointer (`PointerSubInstruction`), the integer offset is multiplied by the
1084
+ * element size to compute the actual number of bytes added to or subtracted from the pointer
1085
+ * address. When computing the integer difference between two pointers (`PointerDiffInstruction`),
1086
+ * the result is computed by computing the difference between the two pointer byte addresses, then
1087
+ * dividing that byte count by the element size.
1081
1088
*/
1082
1089
final int getElementSize ( ) { result = elementSize }
1083
1090
}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
1077
1077
final override string getImmediateString ( ) { result = elementSize .toString ( ) }
1078
1078
1079
1079
/**
1080
- * Gets the size of the element pointed to by the pointer, in bytes.
1080
+ * Gets the size of the elements pointed to by the pointer operands, in bytes.
1081
+ *
1082
+ * When adding an integer offset to a pointer (`PointerAddInstruction`) or subtracting an integer
1083
+ * offset from a pointer (`PointerSubInstruction`), the integer offset is multiplied by the
1084
+ * element size to compute the actual number of bytes added to or subtracted from the pointer
1085
+ * address. When computing the integer difference between two pointers (`PointerDiffInstruction`),
1086
+ * the result is computed by computing the difference between the two pointer byte addresses, then
1087
+ * dividing that byte count by the element size.
1081
1088
*/
1082
1089
final int getElementSize ( ) { result = elementSize }
1083
1090
}
You can’t perform that action at this time.
0 commit comments