The arguments to fusedMultiplyAdd are passed by reference. We must save the Addend value on the beginning of the function, before we modify this, as they may be the same reference.
Fix PR44051.
Differential D70422
[APFloat] Fix fusedMultiplyAdd when `this` equals to `Addend` ekatz on Nov 19 2019, 12:17 AM. Authored by
Details The arguments to fusedMultiplyAdd are passed by reference. We must save the Addend value on the beginning of the function, before we modify this, as they may be the same reference. Fix PR44051.
Diff Detail Event TimelineComment Actions Typo in commit message: "this this"
Comment Actions Pass added parameter by value (instead of - by ref), and have a default value of zero. |
Marginally more efficient to omit the , 0 here, to use the one-argument constructor.
Since we are unconditionally constructing the addend here anyway, would it make more sense to force all callers to pass in an addend (using zero if they're not interested in it)?