[all-commits] [llvm/llvm-project] 08de55: [APFloat] Fix fusedMultiplyAdd when `this` equals ...

Ehud Katz via All-commits all-commits at lists.llvm.org
Mon Jan 6 23:09:36 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 08de551f4f1087c4dd3220fee8ec328fa168168c
      https://github.com/llvm/llvm-project/commit/08de551f4f1087c4dd3220fee8ec328fa168168c
  Author: Ehud Katz <ehudkatz at gmail.com>
  Date:   2020-01-07 (Tue, 07 Jan 2020)

  Changed paths:
    M llvm/include/llvm/ADT/APFloat.h
    M llvm/lib/Support/APFloat.cpp
    M llvm/unittests/ADT/APFloatTest.cpp

  Log Message:
  -----------
  [APFloat] Fix fusedMultiplyAdd when `this` equals to `Addend`

Up until now, 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.

To fix this, we now pass the `addend` parameter of `multiplySignificand`
by value (instead of by-ref), and have a default value of zero.

Fix PR44051.

Differential Revision: https://reviews.llvm.org/D70422




More information about the All-commits mailing list