From 3160935d77c3fd6d24be7fddd5c570d6b3944c18 Mon Sep 17 00:00:00 2001 From: Paul Marinescu Date: Sun, 3 Nov 2013 19:07:20 +0000 Subject: [PATCH] Translate shl overshifts into 0 The other shift operators still need to be changed --- lib/Solver/STPBuilder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Solver/STPBuilder.cpp b/lib/Solver/STPBuilder.cpp index 902526560d..6cb7dd3853 100644 --- a/lib/Solver/STPBuilder.cpp +++ b/lib/Solver/STPBuilder.cpp @@ -223,6 +223,10 @@ ExprHandle STPBuilder::bvVarLeftShift(ExprHandle expr, ExprHandle amount, unsign bvLeftShift(expr, i, shiftBits), res); } + res = vc_iteExpr(vc, + vc_bvLtExpr(vc, amount, bvConst32(32, width)), + res, + bvZero(width)); return res; }