Skip to content

Commit

Permalink
[msan][libcxx] Enable -fsanitize-memory-param-retval
Browse files Browse the repository at this point in the history
We are considering to make -fsanitize-memory-param-retval enabled by default so probably this patch is unnneded.

Reviewed By: #libc, EricWF

Differential Revision: https://reviews.llvm.org/D123979
  • Loading branch information
vitalybuka committed Apr 29, 2022
1 parent 2d13386 commit beff64e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libcxx/CMakeLists.txt
Expand Up @@ -733,7 +733,7 @@ function(get_sanitizer_flags OUT_VAR USE_SANITIZER)
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()
Expand Down
6 changes: 3 additions & 3 deletions libcxx/utils/libcxx/test/params.py
Expand Up @@ -146,9 +146,9 @@ def getStdFlag(cfg, std):
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,
Expand Down

0 comments on commit beff64e

Please sign in to comment.