You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lib/cookie.c and lib/strcase.c team up to trigger an internal compiler error under msvc-14.
Here's a reduced translation unit that triggers the bug.
#include <stddef.h>
#define COOKIE_HASH_SIZE 256
char Curl_raw_toupper(char in);
size_t cookie_hash_domain(const char *domain, const size_t len)
{
const char *end = domain + len;
size_t h = 5381;
while(domain < end) {
h += h << 5;
h ^= Curl_raw_toupper(*domain++);
}
return (h % COOKIE_HASH_SIZE);
}
/*
* cl -O2 -c t.c
*
* t.c(..) : fatal error C1001: An internal error has occurred in the compiler.
* (compiler file 'f:/dd/vctools/compiler/utc/src/p2/main.c', line 246)
* To work around this problem, try simplifying or changing the program near the locations listed above.
* Please choose the Technical Support command on the Visual C++
* Help menu, or open the Technical Support help file for more information
*
* INTERNAL COMPILER ERROR in 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/cl.exe'
* Please choose the Technical Support command on the Visual C++
* Help menu, or open the Technical Support help file for more information
*/
I have verified the bug is hit when _MSC_VER is 1900, but not when _MSC_VER is 1926 (msvc-15).
Disabling optimization for msvc-14 avoids the problem.
It makes me curious. This function you point out to trigger this problem has been around for a long time and lots of users have compiled curl in the mean time. Did really none of them use this optimization level with this compiler version?
Can you submit the proposed work-around as a pull request?
lib/cookie.c and lib/strcase.c team up to trigger an internal compiler error under msvc-14.
Here's a reduced translation unit that triggers the bug.
I have verified the bug is hit when _MSC_VER is 1900, but not when _MSC_VER is 1926 (msvc-15).
Disabling optimization for msvc-14 avoids the problem.
The text was updated successfully, but these errors were encountered: