From: Simon Pilgrim Date: Tue, 14 May 2019 14:13:30 +0000 (+0000) Subject: [APFloat] APFloat::Storage::Storage - fix use after move X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=419a13cb677ef7a4226cda0a550a3e39c6547438;p=llvm [APFloat] APFloat::Storage::Storage - fix use after move This was mentioned both in https://www.viva64.com/en/b/0629/ and by scan-build checks git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360675 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 208950d7ab7..aea59301079 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -4418,9 +4418,9 @@ APFloat::Storage::Storage(IEEEFloat F, const fltSemantics &Semantics) { return; } if (usesLayout(Semantics)) { - new (&Double) - DoubleAPFloat(Semantics, APFloat(std::move(F), F.getSemantics()), - APFloat(semIEEEdouble)); + const fltSemantics IEEESemantics = F.getSemantics(); + new (&Double) DoubleAPFloat(Semantics, APFloat(std::move(F), IEEESemantics), + APFloat(semIEEEdouble)); return; } llvm_unreachable("Unexpected semantics");