Posted to tcl by kbk at Mon Apr 30 18:57:13 GMT 2007view raw

  1. Index: generic/tclProc.c
  2. ===================================================================
  3. RCS file: /cvsroot/tcl/tcl/generic/tclProc.c,v
  4. retrieving revision 1.112
  5. diff -u -b -u -r1.112 tclProc.c
  6. --- generic/tclProc.c 25 Apr 2007 21:59:28 -0000 1.112
  7. +++ generic/tclProc.c 30 Apr 2007 18:55:45 -0000
  8. @@ -230,7 +230,8 @@
  9. * cannot assume that 'line' is valid here, we have to check.
  10. */
  11.  
  12. - if ((context.type == TCL_LOCATION_SOURCE) && context.line
  13. + if (context.type == TCL_LOCATION_SOURCE) {
  14. + if (context.line
  15. && (context.nline >= 4) && (context.line[3] >= 0)) {
  16. int isNew;
  17. CmdFrame *cfPtr = (CmdFrame *) ckalloc(sizeof(CmdFrame));
  18. @@ -245,6 +246,7 @@
  19.  
  20. if (context.type == TCL_LOCATION_SOURCE) {
  21. cfPtr->data.eval.path = context.data.eval.path;
  22. + Tcl_IncrRefCount(cfPtr->data.eval.path);
  23.  
  24. /*
  25. * Transfer of reference. The reference going away (release of
  26. @@ -260,7 +262,10 @@
  27. cfPtr->cmd.str.len = 0;
  28.  
  29. Tcl_SetHashValue(Tcl_CreateHashEntry(iPtr->linePBodyPtr,
  30. - (char *) procPtr, &isNew), cfPtr);
  31. + (char *) procPtr, &isNew),
  32. + cfPtr);
  33. + }
  34. + Tcl_DecrRefCount(context.data.eval.path);
  35. }
  36. }