From 2dd6a0c0c3841af24a6bb7e5025b26df92759c4a Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 15 May 2019 13:03:10 +0000 Subject: [PATCH] Revert rL360675 : [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 ........ There's concerns this may just introduce a use-after-free instead..... llvm-svn: 360770 --- llvm/lib/Support/APFloat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index aea5930..208950d 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -4418,9 +4418,9 @@ APFloat::Storage::Storage(IEEEFloat F, const fltSemantics &Semantics) { return; } if (usesLayout(Semantics)) { - const fltSemantics IEEESemantics = F.getSemantics(); - new (&Double) DoubleAPFloat(Semantics, APFloat(std::move(F), IEEESemantics), - APFloat(semIEEEdouble)); + new (&Double) + DoubleAPFloat(Semantics, APFloat(std::move(F), F.getSemantics()), + APFloat(semIEEEdouble)); return; } llvm_unreachable("Unexpected semantics"); -- 2.7.4