[compiler-rt] [msan] Nit: use init_origins parameter instead of __msan_get_track_origins() in InitShadowWithReExec (PR #86994)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 12:33:23 PDT 2024


https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/86994

This fixes a nit I had accidentally introduced in https://github.com/llvm/llvm-project/pull/85142

I don't think the value of __msan_get_track_origins() will change between the start and end of InitShadowWithReExec, but it's cleaner to use the parameter.


>From 59621dd50c2b81975f70634ea4b19b51dabc1bdc Mon Sep 17 00:00:00 2001
From: Thurston Dang <thurston at google.com>
Date: Thu, 28 Mar 2024 19:26:05 +0000
Subject: [PATCH] [msan] Nit: use init_origins parameter instead of
 __msan_get_track_origins() in InitShadowWithReExec

This fixes a nit I had accidentally introduced in https://github.com/llvm/llvm-project/pull/85142

I don't think the value of __msan_get_track_origins() will change between the start and end of InitShadowWithReExec, but it's cleaner to use the parameter.
---
 compiler-rt/lib/msan/msan_linux.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler-rt/lib/msan/msan_linux.cpp b/compiler-rt/lib/msan/msan_linux.cpp
index cd2d9f5c720c57..c68aec60ae13ea 100644
--- a/compiler-rt/lib/msan/msan_linux.cpp
+++ b/compiler-rt/lib/msan/msan_linux.cpp
@@ -175,7 +175,7 @@ bool InitShadowWithReExec(bool init_origins) {
   // Start with dry run: check layout is ok, but don't print warnings because
   // warning messages will cause tests to fail (even if we successfully re-exec
   // after the warning).
-  bool success = InitShadow(__msan_get_track_origins(), true);
+  bool success = InitShadow(init_origins, true);
   if (!success) {
 #  if SANITIZER_LINUX
     // Perhaps ASLR entropy is too high. If ASLR is enabled, re-exec without it.
@@ -197,7 +197,7 @@ bool InitShadowWithReExec(bool init_origins) {
 
   // The earlier dry run didn't actually map or protect anything. Run again in
   // non-dry run mode.
-  return success && InitShadow(__msan_get_track_origins(), false);
+  return success && InitShadow(init_origins, false);
 }
 
 static void MsanAtExit(void) {



More information about the llvm-commits mailing list