]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Handle 0 :: Ity_I1 as well as 1 :: Ity_I1.
authorJulian Seward <jseward@acm.org>
Mon, 18 Jul 2005 13:54:49 +0000 (13:54 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 18 Jul 2005 13:54:49 +0000 (13:54 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1275

VEX/priv/host-x86/isel.c

index f6fe7f67a574fc603021df948c2429b6adb7ff48..2d3d82754c522073de775fc49619ace8c6e45dc2 100644 (file)
@@ -1492,13 +1492,15 @@ static X86CondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e )
    }
 
    /* Constant 1:Bit */
-   if (e->tag == Iex_Const && e->Iex.Const.con->Ico.U1 == True) {
+   if (e->tag == Iex_Const) {
       HReg r;
       vassert(e->Iex.Const.con->tag == Ico_U1);
+      vassert(e->Iex.Const.con->Ico.U1 == True 
+              || e->Iex.Const.con->Ico.U1 == False);
       r = newVRegI(env);
       addInstr(env, X86Instr_Alu32R(Xalu_MOV,X86RMI_Imm(0),r));
       addInstr(env, X86Instr_Alu32R(Xalu_XOR,X86RMI_Reg(r),r));
-      return Xcc_Z;
+      return e->Iex.Const.con->Ico.U1 ? Xcc_Z : Xcc_NZ;
    }
 
    /* Not1(e) */