Alexander Grund
Alexander Grund
> Why would you add an assertion? Aren't all the shifts constant values? The assertion should be on the `x` not the shift. E.g. `x = (INT_MAX >> 15)` passed...
UBSAN not erroring out is not a guarantee that there is no UB. The code uses e.g. `lrint(scaled_value) >> 16` where scaled value can be negative and that is UB...
I double checked and you are right: No shift is UB as the only problematic shift is in `int_to_fp` which is called with `filter->coeff_half_len`. As this can never be negative...
As written there is no UB, but only implementation defined behaviour which is in `src_float_to_short_array`: - a negative float is passed to `src_float_to_short_array` (e.g. in the tests) - that float...
> I will ask yet again, where is the evidence that this is UB? I don't understand the question. With the steps described above a right shift of a negative...
Sure: My proposed code does not rely on implementation defined behavior (fixes this issue) and additionally does not run into the bug @janstary has with his machines `lrint` implementation due...
That is expected: > When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded. [...] This is often called ‘‘truncation toward...
Tried to validate this but failed on our ppc system and gcc 4.8.2, gcc 8.2.0. All works fine, tests pass. Are you using configure or CMake? Can you attach your...
Yes: `#define CPU_CLIPS_NEGATIVE 1` is zero for me. The whole clipping code is sketchy anyway and I'd remove it. The C standard defines this "clipping" as undefined behavior so I...
> With #define CPU_CLIPS_NEGATIVE 0 (and recompiling), the error stays the same. Ok, expected as this path should not be chosen for this error > Anyway, on this machine, this...