[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:04:38 PDT 2022


vitalybuka created this revision.
Herald added subscribers: arichardson, mgorny.
Herald added a project: All.
vitalybuka requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

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.423520.patch
Type: text/x-patch
Size: 1878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220419/7fb36a32/attachment.bin>


More information about the libcxx-commits mailing list