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 {
10771077 final override string getImmediateString ( ) { result = elementSize .toString ( ) }
10781078
10791079 /**
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.
10811088 */
10821089 final int getElementSize ( ) { result = elementSize }
10831090}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
10771077 final override string getImmediateString ( ) { result = elementSize .toString ( ) }
10781078
10791079 /**
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.
10811088 */
10821089 final int getElementSize ( ) { result = elementSize }
10831090}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
10771077 final override string getImmediateString ( ) { result = elementSize .toString ( ) }
10781078
10791079 /**
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.
10811088 */
10821089 final int getElementSize ( ) { result = elementSize }
10831090}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
10771077 final override string getImmediateString ( ) { result = elementSize .toString ( ) }
10781078
10791079 /**
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.
10811088 */
10821089 final int getElementSize ( ) { result = elementSize }
10831090}
Original file line number Diff line number Diff line change @@ -1077,7 +1077,14 @@ class PointerArithmeticInstruction extends BinaryInstruction {
10771077 final override string getImmediateString ( ) { result = elementSize .toString ( ) }
10781078
10791079 /**
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.
10811088 */
10821089 final int getElementSize ( ) { result = elementSize }
10831090}
You can’t perform that action at this time.
0 commit comments