From: Nick Desaulniers Date: Fri, 7 Jun 2019 19:51:22 +0000 (+0000) Subject: [APFloat] APFloat::Storage::Storage - refix use after move X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87b157182a8305ec108a40cda02a3ac6332a8872;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362833 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 208950d7ab7..d2cd8b4b688 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -4418,8 +4418,9 @@ APFloat::Storage::Storage(IEEEFloat F, const fltSemantics &Semantics) { return; } if (usesLayout(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; }