]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
guest_ppc_toIR: Call vpanic not just vex_printf when the impossible happens
authorMark Wielaard <mark@klomp.org>
Mon, 8 Jun 2020 11:27:28 +0000 (13:27 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 8 Jun 2020 11:34:11 +0000 (13:34 +0200)
is_Zero_Vector, is_Denorm_Vector, is_NaN_Vector and negate_Vector
only handle an Ity_I32 element size. And that is also what they are
currently being called with. In case they would ever be called with
a different element_size they would simply vex_printf and continue
(producing bogus/impossible results). To make this a bit more future
proof (and to silence a static analyzer) vpanic instead.

VEX/priv/guest_ppc_toIR.c

index 6e3fac74f824c6ad343997a4f65d3d6487cacbc4..582c59ec0b418330ed1a57296374ea4ac00b90b1 100644 (file)
@@ -3974,7 +3974,7 @@ static IRExpr * is_Zero_Vector( IRType element_size, IRExpr *src )
       assign( frac_maskV128, unop( Iop_Dup32x4, mkU32( I32_FRACTION_MASK ) ) );
 
    } else
-      vex_printf("ERROR, is_Zero_Vector:  Unknown input size\n");
+      vpanic("ERROR, is_Zero_Vector:  Unknown input size");
 
    /* CmpEQ32x4 returns all 1's in elements where comparison is true */
    assign( exp_zeroV128,
@@ -4011,7 +4011,7 @@ static IRExpr * is_Denorm_Vector( IRType element_size, IRExpr *src )
       assign( frac_maskV128, unop( Iop_Dup32x4, mkU32( I32_FRACTION_MASK ) ) );
 
    } else
-      vex_printf("ERROR, is_Denorm_Vector:  Unknown input size\n");
+      vpanic("ERROR, is_Denorm_Vector:  Unknown input size");
 
    /* CmpEQ32x4 returns all 1's in elements where comparison is true */
    assign( exp_zeroV128,
@@ -4048,7 +4048,7 @@ static IRExpr * is_NaN_Vector( IRType element_size, IRExpr *src )
       opCmpEQ = Iop_CmpEQ32x4;
 
    } else
-      vex_printf("ERROR, is_NaN_Vector:  Unknown input size\n");
+      vpanic("ERROR, is_NaN_Vector:  Unknown input size");
 
    /* check exponent is all ones, i.e. (exp AND exp_mask) = exp_mask */
    assign( max_expV128,
@@ -4307,7 +4307,7 @@ static IRExpr* negate_Vector ( IRType element_size, IRExpr* value )
       assign( sign_maskV128, unop( Iop_Dup32x4, mkU32( I32_SIGN_MASK ) ) );
 
    } else
-      vex_printf("ERROR, negate_Vector:  Unknown input size\n");
+      vpanic("ERROR, negate_Vector:  Unknown input size");
 
    /* Determine if vector elementes are not a NaN, negate sign bit
       for non NaN elements */