[PATCH] D44243: [asan] Make ScopedInErrorReport::current_error_ linker-initialized

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 09:35:30 PST 2018


delcypher added a comment.

Based on other code that uses `LINKER_INITIALIZED` this seems reasonable. However I have no idea how this is supposed to actually work.



================
Comment at: lib/asan/asan_report.cc:205
 
-ErrorDescription ScopedInErrorReport::current_error_;
+ErrorDescription ScopedInErrorReport::current_error_(LINKER_INITIALIZED);
 
----------------
How does `LINKER_INITIALIZED` guarantee that the linker will actually initialize the struct? It looks like it's just a member of an enum, so it doesn't actually do anything.

My naive reading of this code is that you're trying to avoid the call to `internal_memset(this, 0, sizeof(*this))`. It looks like this will mean though that the anonymous union won't be initialized.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D44243





More information about the llvm-commits mailing list