aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/example.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-08-14 15:55:46 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-23 07:46:40 +0200
commitdc4117c69ef98d2e79de1fab18ea0ba9d1496344 (patch)
treec27eba2819576ac4878a1c92672cc79b62407c76 /example.c
parent52856c815a191b73530557133bd44ec478f3fece (diff)
downloadsparse-dev-dc4117c69ef98d2e79de1fab18ea0ba9d1496344.tar.gz
cast: specialize casts from unsigned to pointers
Currently all casts to pointers are processed alike. This is simple but rather unconvenient as it correspond to different operations that obeys to different rules and which later need extra checks. Change this by using a specific instructions (OP_UTPTR) for unsigned integer to pointers. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'example.c')
-rw-r--r--example.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/example.c b/example.c
index 8f0869c9..2bc9de2c 100644
--- a/example.c
+++ b/example.c
@@ -81,6 +81,7 @@ static const char *opcodes[] = {
[OP_UCVTF] = "ucvtf",
[OP_SCVTF] = "scvtf",
[OP_FCVTF] = "fcvtf",
+ [OP_UTPTR] = "utptr",
[OP_PTRCAST] = "ptrcast",
[OP_CALL] = "call",
[OP_SLICE] = "slice",
@@ -1414,6 +1415,7 @@ static void generate_one_insn(struct instruction *insn, struct bb_state *state)
break;
case OP_CAST: case OP_SCAST: case OP_PTRCAST:
+ case OP_UTPTR:
case OP_FCVTU: case OP_FCVTS:
case OP_UCVTF: case OP_SCVTF:
case OP_FCVTF: