[PATCH] D66420: Be explicit about Windows coff name trailing character policy

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 13:17:40 PDT 2019


serge-sans-paille marked an inline comment as done.
serge-sans-paille added a comment.

The gcc analysis is not interprocedural.



================
Comment at: llvm/lib/Object/WindowsResource.cpp:520-521
+// it's okay to *not* copy the trailing zero.
+template <size_t DestSize>
+static void coffnamecpy(char (&Dest)[DestSize], StringRef Src) {
+  static_assert(DestSize <= COFF::NameSize, "Dest is large enough");
----------------
rnk wrote:
> Can we drop the template parameter and make `Dest` `char (&Dest)[COFF::NameSize]`? Then all we need is the assert for `Src.size() <= COFF::NameSize`.
Sure.


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

https://reviews.llvm.org/D66420





More information about the llvm-commits mailing list