[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 64/72] softfloat: Pad array size in pick_nan_muladd
From: |
Peter Maydell |
Subject: |
[PULL 64/72] softfloat: Pad array size in pick_nan_muladd |
Date: |
Wed, 11 Dec 2024 16:19:56 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
While all indices into val[] should be in [0-2], the mask
applied is two bits. To help static analysis see there is
no possibility of read beyond the end of the array, pad the
array to 4 entries, with the final being (implicitly) NULL.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20241203203949.483774-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
fpu/softfloat-parts.c.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc
index 525db617411..5fcdbc87fd7 100644
--- a/fpu/softfloat-parts.c.inc
+++ b/fpu/softfloat-parts.c.inc
@@ -106,7 +106,7 @@ static FloatPartsN *partsN(pick_nan_muladd)(FloatPartsN *a,
FloatPartsN *b,
}
ret = c;
} else {
- FloatPartsN *val[3] = { a, b, c };
+ FloatPartsN *val[R_3NAN_1ST_MASK + 1] = { a, b, c };
Float3NaNPropRule rule = s->float_3nan_prop_rule;
assert(rule != float_3nan_prop_none);
--
2.34.1
- [PULL 59/72] target/tricore: Set default NaN pattern explicitly, (continued)
- [PULL 59/72] target/tricore: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 62/72] softfloat: Use goto for default nan case in pick_nan_muladd, Peter Maydell, 2024/12/11
- [PULL 70/72] softfloat: Replace WHICH with RET in parts_pick_nan, Peter Maydell, 2024/12/11
- [PULL 66/72] softfloat: Use parts_pick_nan in propagateFloatx80NaN, Peter Maydell, 2024/12/11
- [PULL 65/72] softfloat: Move propagateFloatx80NaN to softfloat.c, Peter Maydell, 2024/12/11
- [PULL 68/72] softfloat: Share code between parts_pick_nan cases, Peter Maydell, 2024/12/11
- [PULL 71/72] MAINTAINERS: update email address for Leif Lindholm, Peter Maydell, 2024/12/11
- [PULL 69/72] softfloat: Sink frac_cmp in parts_pick_nan until needed, Peter Maydell, 2024/12/11
- [PULL 57/72] target/hexagon: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 53/72] target/rx: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 64/72] softfloat: Pad array size in pick_nan_muladd,
Peter Maydell <=
- [PULL 67/72] softfloat: Inline pickNaN, Peter Maydell, 2024/12/11
- [PULL 72/72] MAINTAINERS: Add correct email address for Vikram Garhwal, Peter Maydell, 2024/12/11
- Re: [PULL 00/72] target-arm queue, Stefan Hajnoczi, 2024/12/12