diff options
author | Jim Ma <mazong1123@gmail.com> | 2017-04-07 23:33:21 +0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-04-07 08:33:21 -0700 |
commit | a86df0d0abe3ca5a7eed1db673c4ea48cfc3c61c (patch) | |
tree | 91db4f1db9caad44cf81ee673ff3781c8647b831 /src | |
parent | 6f0bd8d2b7d956cda9c0d80315ca9a853d2a4680 (diff) | |
download | coreclr-a86df0d0abe3ca5a7eed1db673c4ea48cfc3c61c.tar.gz coreclr-a86df0d0abe3ca5a7eed1db673c4ea48cfc3c61c.tar.bz2 coreclr-a86df0d0abe3ca5a7eed1db673c4ea48cfc3c61c.zip |
Handle unsupported varargs tests on Unix gracefully. (#10794)
Some of mcc_i* tests caused segmentation faults on Unix. This commit make these tests exit by throwing a System.EntryPointNotFoundException exception instead of causing a segmentation fault.
Fix #9530
Diffstat (limited to 'src')
-rw-r--r-- | src/pal/src/loader/module.cpp | 20 | ||||
-rw-r--r-- | src/vm/method.cpp | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/pal/src/loader/module.cpp b/src/pal/src/loader/module.cpp index 63a65ffb61..bbe8b9ddcc 100644 --- a/src/pal/src/loader/module.cpp +++ b/src/pal/src/loader/module.cpp @@ -280,6 +280,16 @@ GetProcAddress( module = (MODSTRUCT *) hModule; + /* try to assert on attempt to locate symbol by ordinal */ + /* this can't be an exact test for HIWORD((DWORD)lpProcName) == 0 + because of the address range reserved for ordinals contain can + be a valid string address on non-Windows systems + */ + if ((DWORD_PTR)lpProcName < VIRTUAL_PAGE_SIZE) + { + ASSERT("Attempt to locate symbol by ordinal?!\n"); + } + /* parameter validation */ if ((lpProcName == nullptr) || (*lpProcName == '\0')) @@ -295,16 +305,6 @@ GetProcAddress( SetLastError(ERROR_INVALID_HANDLE); goto done; } - - /* try to assert on attempt to locate symbol by ordinal */ - /* this can't be an exact test for HIWORD((DWORD)lpProcName) == 0 - because of the address range reserved for ordinals contain can - be a valid string address on non-Windows systems - */ - if ((DWORD_PTR)lpProcName < VIRTUAL_PAGE_SIZE) - { - ASSERT("Attempt to locate symbol by ordinal?!\n"); - } // Get the symbol's address. diff --git a/src/vm/method.cpp b/src/vm/method.cpp index 834ab63d58..a72b07b404 100644 --- a/src/vm/method.cpp +++ b/src/vm/method.cpp @@ -5042,12 +5042,14 @@ LPVOID NDirectMethodDesc::FindEntryPoint(HINSTANCE hMod) const FARPROC pFunc = NULL, pFuncW = NULL; +#ifndef FEATURE_PAL // Handle ordinals. if (GetEntrypointName()[0] == '#') { long ordinal = atol(GetEntrypointName()+1); return reinterpret_cast<LPVOID>(GetProcAddress(hMod, (LPCSTR)(size_t)((UINT16)ordinal))); } +#endif // Just look for the unmangled name. If it is unicode fcn, we are going // to need to check for the 'W' API because it takes precedence over the |