aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Documentation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-08-15 10:10:45 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-23 07:46:40 +0200
commitbf21036518acf0c3069c9c9e12b13fd09c8cdceb (patch)
tree720faac5d58dac28939fbb805c85810929f6c439 /Documentation
parent756b6133e7f6605d86d0d74fd939991b11aeb1e4 (diff)
downloadsparse-dev-bf21036518acf0c3069c9c9e12b13fd09c8cdceb.tar.gz
cast: make casts from pointer always size preserving
Currently casts from pointers can be done to any integer type. However, casts to (or from) pointers are only meaningful if it preserves the value and thus done between same-sized objects. To avoid to have to worry about sign/zero extension while doing casts to pointers it's good to not have to deal with such casts. Do this by doing first a cast to an unsigned integer of the same size as a pointer and then, if needed, doing to cast to the final type. As such we have only to support pointer casts to unsigned integers of the same size and on the other hand we have the generic integer-to-interger casts we to support anyway. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/IR.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/IR.rst b/Documentation/IR.rst
index 61575386..1cce2de1 100644
--- a/Documentation/IR.rst
+++ b/Documentation/IR.rst
@@ -277,7 +277,7 @@ an unsigned integer of the same size.
Cast from pointer-sized unsigned integer to pointer type.
.. op:: OP_PTRTU
- Cast from pointer type to unsigned integer.
+ Cast from pointer type to pointer-sized unsigned integer.
.. op:: OP_PTRCAST
Cast between pointers.