]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
In 64 bit mode, allow 64 bit return values from clean helper calls.
authorJulian Seward <jseward@acm.org>
Mon, 21 Oct 2013 10:05:33 +0000 (10:05 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 21 Oct 2013 10:05:33 +0000 (10:05 +0000)
This makes SMC checking calls work (even though they are irrelevant
on PPC targets).  Fixes #309430.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2793

VEX/priv/host_ppc_isel.c

index f493e034256f7f0ebadb67c38b1eb5295f944c95..724fee8825c6b56bf21d9412e6735159d97e39b9 100644 (file)
@@ -2312,12 +2312,11 @@ static HReg iselWordExpr_R_wrk ( ISelEnv* env, IRExpr* e )
 
    /* --------- CCALL --------- */
    case Iex_CCall: {
-      HReg    r_dst = newVRegI(env);
-      vassert(ty == Ity_I32);
+      vassert(ty == e->Iex.CCall.retty); /* well-formedness of IR */
 
       /* be very restrictive for now.  Only 32/64-bit ints allowed for
-         args, and 32 bits for return type. */
-      if (e->Iex.CCall.retty != Ity_I32)
+         args, and 32 bits or host machine word for return type. */
+      if (!(ty == Ity_I32 || (mode64 && ty == Ity_I64)))
          goto irreducible;
 
       /* Marshal args, do the call, clear stack. */
@@ -2330,6 +2329,7 @@ static HReg iselWordExpr_R_wrk ( ISelEnv* env, IRExpr* e )
       vassert(addToSp == 0);
 
       /* GPR3 now holds the destination address from Pin_Goto */
+      HReg r_dst = newVRegI(env);
       addInstr(env, mk_iMOVds_RR(r_dst, hregPPC_GPR3(mode64)));
       return r_dst;
    }