aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-03-20 00:03:33 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-11-16 21:14:14 +0100
commitdc8526ff0792fcf34c93ed43a4248b361090d103 (patch)
treeb810f30739a995246c646593eae46513c52555ce
parent0e5ac86500040e8abda1bfa9a7c9084a7dd690a4 (diff)
downloadsparse-dev-dc8526ff0792fcf34c93ed43a4248b361090d103.tar.gz
give a type to OP_SWITCHs
For consistency and for sparse-LLVM which needs it, give them a type too. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--linearize.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/linearize.c b/linearize.c
index d22e4392..dfbcd3ab 100644
--- a/linearize.c
+++ b/linearize.c
@@ -1907,16 +1907,17 @@ static pseudo_t linearize_switch(struct entrypoint *ep, struct statement *stmt)
struct instruction *switch_ins;
struct basic_block *switch_end = alloc_basic_block(ep, stmt->pos);
struct basic_block *active, *default_case;
+ struct expression *expr = stmt->switch_expression;
struct multijmp *jmp;
pseudo_t pseudo;
- pseudo = linearize_expression(ep, stmt->switch_expression);
+ pseudo = linearize_expression(ep, expr);
active = ep->active;
if (!bb_reachable(active))
return VOID;
- switch_ins = alloc_instruction(OP_SWITCH, 0);
+ switch_ins = alloc_typed_instruction(OP_SWITCH, expr->ctype);
use_pseudo(switch_ins, pseudo, &switch_ins->cond);
add_one_insn(ep, switch_ins);
finish_block(ep);