[libcxx-commits] [PATCH] D82627: Fix CFI issues in <future>

Brandon Tolsch via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 26 01:36:34 PDT 2020


btolsch marked an inline comment as done.
btolsch added a comment.

F12243471: cfi_test.sh <https://reviews.llvm.org/F12243471>

F12243470: cfi_test.cc <https://reviews.llvm.org/F12243470>

I attached a small repro case, but I don't know if there's a way to make this into a unit test.  LMK if that's something you want and where I would add it.  Also, I wasn't able to get any of the clang-format tools to work, and just running clang-format with the included .clang-format of the repo completely changed the whole file.  I think I kept the diff in the existing style though.  Lastly, I ran `make check-cxx` and that passed.



================
Comment at: libcxx/include/future:1756
     virtual ~__packaged_task_base() {}
-    virtual void __move_to(__packaged_task_base*) _NOEXCEPT = 0;
+    virtual void __move_to(void*) _NOEXCEPT = 0;
     virtual void destroy() = 0;
----------------
I expect this may be the more contentious part of the change.  The implementation is doing a placement new, which is initializing the memory, so there seems to be no way to make CFI okay with calling this a `__packaged_task_base*` when it //can't// be initialized before this point.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82627/new/

https://reviews.llvm.org/D82627





More information about the libcxx-commits mailing list