[libcxx-commits] [PATCH] D123979: [msan][libcxx] Enable -fsanitize-memory-param-retval

Vitaly Buka via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 18 21:05:39 PDT 2022


vitalybuka updated this revision to Diff 423524.
vitalybuka added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123979

Files:
  libcxx/CMakeLists.txt
  libcxx/utils/libcxx/test/params.py


Index: libcxx/utils/libcxx/test/params.py
===================================================================
--- libcxx/utils/libcxx/test/params.py
+++ libcxx/utils/libcxx/test/params.py
@@ -146,9 +146,9 @@
               AddFlag('-fsanitize=address') if sanitizer == 'Address' else None,
               AddFeature('asan')            if sanitizer == 'Address' else None,
 
-              AddFlag('-fsanitize=memory')               if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
-              AddFeature('msan')                         if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
-              AddFlag('-fsanitize-memory-track-origins') if sanitizer == 'MemoryWithOrigins' else None,
+              AddFlag('-fsanitize=memory -fsanitize-memory-param-retval') if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
+              AddFeature('msan')                                          if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
+              AddFlag('-fsanitize-memory-track-origins')                  if sanitizer == 'MemoryWithOrigins' else None,
 
               AddFlag('-fsanitize=thread') if sanitizer == 'Thread' else None,
               AddFeature('tsan')           if sanitizer == 'Thread' else None,
Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -733,7 +733,7 @@
     if (USE_SANITIZER STREQUAL "Address")
       append_flags(SANITIZER_FLAGS "-fsanitize=address")
     elseif (USE_SANITIZER MATCHES "Memory(WithOrigins)?")
-      append_flags(SANITIZER_FLAGS -fsanitize=memory)
+      append_flags(SANITIZER_FLAGS -fsanitize=memory -fsanitize-memory-param-retval)
       if (USE_SANITIZER STREQUAL "MemoryWithOrigins")
         append_flags(SANITIZER_FLAGS "-fsanitize-memory-track-origins")
       endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123979.423524.patch
Type: text/x-patch
Size: 1878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220419/894d0cbd/attachment-0001.bin>


More information about the libcxx-commits mailing list