aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sparse.c
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 /sparse.c
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 'sparse.c')
-rw-r--r--sparse.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/sparse.c b/sparse.c
index d4884007..afdc314e 100644
--- a/sparse.c
+++ b/sparse.c
@@ -217,7 +217,6 @@ static void check_one_instruction(struct instruction *insn)
{
switch (insn->opcode) {
case OP_CAST: case OP_SCAST:
- case OP_PTRTU:
if (verbose)
check_cast_instruction(insn);
break;