[PATCH] D50743: libcxx: Mark __temp_value::__temp_value as _LIBCPP_NO_CFI.

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 15 10:50:17 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCXX339797: libcxx: Mark __temp_value::__temp_value as _LIBCPP_NO_CFI. (authored by pcc, committed by ).
Herald added subscribers: cfe-commits, ldionne.

Changed prior to commit:
  https://reviews.llvm.org/D50743?vs=160712&id=160852#toc

Repository:
  rCXX libc++

https://reviews.llvm.org/D50743

Files:
  include/memory


Index: include/memory
===================================================================
--- include/memory
+++ include/memory
@@ -5631,8 +5631,11 @@
     _Tp &   get() { return *__addr(); }
 
     template<class... _Args>
-    __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc)
-    { _Traits::construct(__a, __addr(), _VSTD::forward<_Args>(__args)...); }
+    _LIBCPP_NO_CFI
+    __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
+      _Traits::construct(__a, reinterpret_cast<_Tp*>(addressof(__v)),
+                         _VSTD::forward<_Args>(__args)...);
+    }
 
     ~__temp_value() { _Traits::destroy(__a, __addr()); }
     };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50743.160852.patch
Type: text/x-patch
Size: 671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180815/2a97c50d/attachment.bin>


More information about the cfe-commits mailing list