Overview
| Artifact ID: | 8cf68b864ce7ec1af10f997a08c516f665f214b0673cac8818ad576d32e594f6 |
|---|---|
| Ticket: | 8ecaee5d83a8d8694bd0585066d6d6f71c28ce73
[array for] memory corruption |
| User & Date: | bll on 2018-04-23 10:51:35 |
Changes
- icomment:
The varPtr assignment needs to be moved below the result check. Index: generic/tclVar.c ================================================================== --- generic/tclVar.c +++ generic/tclVar.c @@ -3128,12 +3128,10 @@ /* * Process the result from the previous execution of the script body. */ done = TCL_ERROR; - varPtr = TclObjLookupVarEx(interp, searchPtr->arrayNameObj, NULL, /*flags*/ 0, - /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); if (result == TCL_CONTINUE) { result = TCL_OK; } else if (result != TCL_OK) { if (result == TCL_BREAK) { @@ -3144,10 +3142,13 @@ "\n (\"array for\" body line %d)", Tcl_GetErrorLine(interp))); } goto arrayfordone; } + + varPtr = TclObjLookupVarEx(interp, searchPtr->arrayNameObj, NULL, /*flags*/ 0, + /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); /* * Get the next mapping from the array. */ - login: "bll"
- mimetype: "text/plain"