From 399ff58753b792a44366a734a27406c74e829607 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..... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360770 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APFloat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index aea59301079..208950d7ab7 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)) { - 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.50.1