Overview
| Artifact ID: | 95bac0ca5f82a0f10d335116e92dd4911bd035a1 |
|---|---|
| Ticket: | c383ebb5e414458cd386e6016e59f693e3840e81
"glob -path a" core dumps instead of argument error |
| User & Date: | dah on 2016-06-14 23:48:38 |
Changes
- icomment:
Ok, in case anyone is interested, it doesn't crash when compiled with gcc due to an optimization where it reuses local variable storage. There is a DString "pref" initialization done before the code block triggering the crash with MSVC, and that same storage is reused later for DString "str" (with gcc). Below is essentially what is happening and shouldn't crash with gcc either, but does with MSVC: #include <tcl.h> #include <stdio.h> int main (int argc, char *argv[]) { if (1) { Tcl_DString one; Tcl_DStringInit(&one); Tcl_DStringFree(&one); } if (2) { /* Should crash, but gcc saves the day! two -> one */ Tcl_DString two; Tcl_DStringFree(&two); } } This isn't a Windows only bug, I suspect it will manifest itself with other compilers. - login: "dah"
- mimetype: "text/plain"
- username: "dah"