|
From: Mark W. <ma...@so...> - 2020-06-08 11:35:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4285dff54d09a48e78c138fba100bca2a481b471 commit 4285dff54d09a48e78c138fba100bca2a481b471 Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 8 13:27:28 2020 +0200 guest_ppc_toIR: Call vpanic not just vex_printf when the impossible happens 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. Diff: --- VEX/priv/guest_ppc_toIR.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index 6e3fac74f8..582c59ec0b 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -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 */ |