summaryrefslogtreecommitdiff
path: root/src/vm/ceeload.cpp
diff options
context:
space:
mode:
authorMichelle McDaniel <adiaaida@gmail.com>2018-09-07 13:08:25 -0700
committerGitHub <noreply@github.com>2018-09-07 13:08:25 -0700
commitd81a3685df482e8962bf696e44b9071f19bfac2f (patch)
treefd004c0fc82058ed92a3907fc70c967c9dc68623 /src/vm/ceeload.cpp
parent36449cf94237e7cddb7e43a9fe6f873e7f5ebf77 (diff)
downloadcoreclr-d81a3685df482e8962bf696e44b9071f19bfac2f.tar.gz
coreclr-d81a3685df482e8962bf696e44b9071f19bfac2f.tar.bz2
coreclr-d81a3685df482e8962bf696e44b9071f19bfac2f.zip
Fix the slashes when setting the ZapBBInstrDir (#19858)
In OpenMethodProfileDataLogFile, we try to set the directory and path for the .ibc files using windows slashes (\). This causes this code to fail on Linux, which uses forward slashes. This is particularly a problem when setting COMPlus_ZapBBInstrDir, which takes that environment variable and attempts to find the name of the file using wcsrchr(assemblyPath, '\'). This causes a crash on linux when collecting IBC counts. The fix is to ifdef it for linux to use the correct path separator. This change also includes a fix to change the code for checking if IbcTuning is set to use == instead of -eq which was causing a failure in the build that was ignored.
Diffstat (limited to 'src/vm/ceeload.cpp')
-rw-r--r--src/vm/ceeload.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp
index 19c5167005..ffdaea86fe 100644
--- a/src/vm/ceeload.cpp
+++ b/src/vm/ceeload.cpp
@@ -11336,14 +11336,14 @@ HANDLE Module::OpenMethodProfileDataLogFile(GUID mvid)
path.Set(assemblyPath); // no, then put it beside the IL dll
}
else {
- LPCWSTR assemblyFileName = wcsrchr(assemblyPath, '\\');
+ LPCWSTR assemblyFileName = wcsrchr(assemblyPath, DIRECTORY_SEPARATOR_CHAR_W);
if (assemblyFileName)
assemblyFileName++; // skip past the \ char
else
assemblyFileName = assemblyPath;
path.Set(ibcDir); // yes, put it in the directory, named with the assembly name.
- path.Append('\\');
+ path.Append(DIRECTORY_SEPARATOR_CHAR_W);
path.Append(assemblyFileName);
}