Skip to content

Commit 72d04aa

Browse files
committed
scheck: fix type of operands in casts
Casts were using the target type for their operands. Fix this by using the new helper mkivar() for them. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
1 parent 732bc04 commit 72d04aa

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

‎scheck.c‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,16 @@ static void icmp(Btor *btor, struct instruction *insn)
165165

166166
static void unop(Btor *btor, struct instruction *insn)
167167
{
168-
BoolectorSort s = get_sort(btor, insn->type, insn->pos);
169-
BoolectorNode *t, *a;
168+
pseudo_t src = insn->src;
169+
BoolectorNode *t;
170170

171-
a = mkvar(btor, s, insn->src1);
172-
if (!a)
173-
return;
174171
switch (insn->opcode) {
175-
case OP_NEG: t = boolector_neg(btor, a); break;
176-
case OP_NOT: t = boolector_not(btor, a); break;
177-
case OP_SEXT: t = sext(btor, insn, a); break;
178-
case OP_ZEXT: t = zext(btor, insn, a); break;
179-
case OP_TRUNC: t = slice(btor, insn, a); break;
172+
case OP_SEXT: t = sext(btor, insn, mkivar(btor, insn, src)); break;
173+
case OP_ZEXT: t = zext(btor, insn, mkivar(btor, insn, src)); break;
174+
case OP_TRUNC: t = slice(btor, insn, mkivar(btor, insn, src)); break;
175+
176+
case OP_NEG: t = boolector_neg(btor, mktvar(btor, insn, src)); break;
177+
case OP_NOT: t = boolector_not(btor, mktvar(btor, insn, src)); break;
180178
default:
181179
fprintf(stderr, "unsupported insn: %s\n", show_instruction(insn));
182180
return;

0 commit comments

Comments
 (0)