diff options
author | John Chen <jochen@microsoft.com> | 2016-05-18 02:46:23 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-05-18 02:46:23 -0700 |
commit | acd2bba2231e07f006846b44e790c5073d7c6019 (patch) | |
tree | 37e1b85f545e3bed98d8409b60f323d50c3bb3ba /src/binder | |
parent | 7e9bd0570ed853e7fcf524537388b1bc43ce086f (diff) | |
download | coreclr-acd2bba2231e07f006846b44e790c5073d7c6019.tar.gz coreclr-acd2bba2231e07f006846b44e790c5073d7c6019.tar.bz2 coreclr-acd2bba2231e07f006846b44e790c5073d7c6019.zip |
Fix crossgen /createpdb when input filename is given without path (#5045)
Fix a bug in "crossgen /createpdb" command that can cause it to fail
if the input filename is given without a path.
Diffstat (limited to 'src/binder')
-rw-r--r-- | src/binder/applicationcontext.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/binder/applicationcontext.cpp b/src/binder/applicationcontext.cpp index 27f860e927..e5c3025787 100644 --- a/src/binder/applicationcontext.cpp +++ b/src/binder/applicationcontext.cpp @@ -265,8 +265,17 @@ namespace BINDER_SPACE if (!fileName.FindBack(iSimpleNameStart, DIRECTORY_SEPARATOR_CHAR_W)) { +#ifdef CROSSGEN_COMPILE + iSimpleNameStart = fileName.Begin(); +#else // Couldn't find a directory separator. File must have been specified as a relative path. Not allowed. GO_WITH_HRESULT(E_INVALIDARG); +#endif + } + else + { + // Advance past the directory separator to the first character of the file name + iSimpleNameStart++; } if (iSimpleNameStart == fileName.End()) @@ -274,9 +283,6 @@ namespace BINDER_SPACE GO_WITH_HRESULT(E_INVALIDARG); } - // Advance past the directory separator to the first character of the file name - iSimpleNameStart++; - SString simpleName; bool isNativeImage = false; |