Skip to content

Commit

Permalink
[APFloat] APFloat::Storage::Storage - refix use after move
Browse files Browse the repository at this point in the history
Summary:
Re-land r360675 after it was reverted in r360770.

This was reported in:
https://llvm.org/reports/scan-build/

Based on feedback in:
https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190513/652286.html

Reviewers: RKSimon, efriedma

Reviewed By: RKSimon, efriedma

Subscribers: eli.friedman, hiraditya, llvm-commits, srhines

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362833 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
nickdesaulniers committed Jun 7, 2019
1 parent 883ef72 commit 87b1571
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Support/APFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4418,8 +4418,9 @@ APFloat::Storage::Storage(IEEEFloat F, const fltSemantics &Semantics) {
return;
}
if (usesLayout<DoubleAPFloat>(Semantics)) {
const fltSemantics& S = F.getSemantics();
new (&Double)
DoubleAPFloat(Semantics, APFloat(std::move(F), F.getSemantics()),
DoubleAPFloat(Semantics, APFloat(std::move(F), S),
APFloat(semIEEEdouble));
return;
}
Expand Down

0 comments on commit 87b1571

Please sign in to comment.