[llvm] r362833 - [APFloat] APFloat::Storage::Storage - refix use after move
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 12:51:22 PDT 2019
Author: nickdesaulniers
Date: Fri Jun 7 12:51:22 2019
New Revision: 362833
URL: http://llvm.org/viewvc/llvm-project?rev=362833&view=rev
Log:
[APFloat] APFloat::Storage::Storage - refix use after move
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
Modified:
llvm/trunk/lib/Support/APFloat.cpp
Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=362833&r1=362832&r2=362833&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Fri Jun 7 12:51:22 2019
@@ -4418,8 +4418,9 @@ APFloat::Storage::Storage(IEEEFloat F, c
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;
}
More information about the llvm-commits
mailing list