Tcl Source Code

Check-in [b3333814a0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[Bug 3398794]: Use Tcl errors in scripts, not panics.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: b3333814a0462238692d4cd7e19feffe2e3f39ea
User & Date: dkf 2011-08-30 00:05:19
Context
2011-08-30
07:34
merge-mark check-in: a726f434cd user: jan.nijtmans tags: core-8-5-branch
00:23
[Bug 3398794]: Use Tcl errors in scripts, not panics. check-in: 241cdd7be1 user: dkf tags: trunk
00:05
[Bug 3398794]: Use Tcl errors in scripts, not panics. check-in: b3333814a0 user: dkf tags: core-8-5-branch
2011-08-23
07:15
gcc 4.6 (64-bit) warnings check-in: cfbdbc28cb user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.









1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72








2011-08-19  Alexandre Ferrieux  <[email protected]>

	* generic/tclTest.c: [Bug 2981154] async-4.3 segfault.
	* tests/async.test:  [Bug 1774689] async-4.3 sometimes fails.

2011-08-18  Jan Nijtmans  <[email protected]>

	* generic/tclUniData.c: [Bug 3393714] overflow in toupper delta
	* tools/uniParse.tcl
	* tests/utf.test

2011-08-17  Don Porter  <[email protected]>

	* generic/tclGet.c: [Bug 3393150] Overlooked free of intreps.
	(It matters for bignums!)

2011-08-16  Jan Nijtmans  <[email protected]>

	* generic/tclCmdAH.c:    [Bug 3388350] mingw64 compiler warnings
	* generic/tclFCmd.c      In mingw, sys/stat.h must be included
	* generic/tclFileName.c  before winsock2.h, so make sure of that.
	* generic/tclIOUtil.c
	* generic/tclBasic.c
	* generic/tclBinary.c
	* generic/tclHash.c
	* generic/tclTest.c
	* win/tclWinChan.c
	* win/tclWinConsole.c
	* win/tclWinDde.c
	* win/tclWinFile.c
	* win/tclWinReg.c
	* win/tclWinSerial.c
	* win/tclWinSock.c
	* win/tclWinThrd.c

2011-08-15  Don Porter  <[email protected]>

	* generic/tclBasic.c: [Bug 3390272] Leak of [info script] value.

2011-08-15  Jan Nijtmans  <[email protected]>

	* win/tclWinPort.h:    [Bug 3388350] mingw64 compiler warnings
	* win/tclWinPipe.c
	* win/tclWinSock.c
	* win/configure.in
	* win/configure
	* generic/tclPosixStr.c
	* generic/tclStrToD.c

2011-08-12  Don Porter  <[email protected]>

	* generic/tclPathObj.c:	[Bug 3389764] Eliminate possibility that dup
	of a "path" value can create reference cycle.

2011-08-09  Jan Nijtmans  <[email protected]>

	* win/tclWinConsole.c: [Bug 3388350] mingw64 compiler warnings
	* win/tclWinDde.c
	* win/tclWinPipe.c
	* win/tclWinSerial.c

2011-08-05  Kevin B. Kenny  <[email protected]>

	* generic/tclStrToD.c: Plugged a memory leak in double->string
	conversion. [Bug 3386975]

2011-07-28  Don Porter  <[email protected]>

	* library/tzdata/Asia/Anadyr: Update to Olson's tzdata2011h
	* library/tzdata/Asia/Irkutsk:
	* library/tzdata/Asia/Kamchatka:
	* library/tzdata/Asia/Krasnoyarsk:
>
>
>
>
>
>
>
>


|
|



|





|




|


















|



|









|




|






|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
2011-08-30  Donal K. Fellows  <[email protected]>

	* generic/tclInterp.c (SlaveCommandLimitCmd, SlaveTimeLimitCmd):
	[Bug 3398794]: Ensure that low-level conditions in the limit API are
	enforced at the script level through errors, not a Tcl_Panic. This
	means that interpreters cannot read their own limits (writing already
	did not work).

2011-08-19  Alexandre Ferrieux  <[email protected]>

	* generic/tclTest.c: [Bug 2981154]: async-4.3 segfault.
	* tests/async.test:  [Bug 1774689]: async-4.3 sometimes fails.

2011-08-18  Jan Nijtmans  <[email protected]>

	* generic/tclUniData.c: [Bug 3393714]: Overflow in toupper delta
	* tools/uniParse.tcl
	* tests/utf.test

2011-08-17  Don Porter  <[email protected]>

	* generic/tclGet.c: [Bug 3393150]: Overlooked free of intreps.
	(It matters for bignums!)

2011-08-16  Jan Nijtmans  <[email protected]>

	* generic/tclCmdAH.c:    [Bug 3388350]: mingw64 compiler warnings
	* generic/tclFCmd.c      In mingw, sys/stat.h must be included
	* generic/tclFileName.c  before winsock2.h, so make sure of that.
	* generic/tclIOUtil.c
	* generic/tclBasic.c
	* generic/tclBinary.c
	* generic/tclHash.c
	* generic/tclTest.c
	* win/tclWinChan.c
	* win/tclWinConsole.c
	* win/tclWinDde.c
	* win/tclWinFile.c
	* win/tclWinReg.c
	* win/tclWinSerial.c
	* win/tclWinSock.c
	* win/tclWinThrd.c

2011-08-15  Don Porter  <[email protected]>

	* generic/tclBasic.c: [Bug 3390272]: Leak of [info script] value.

2011-08-15  Jan Nijtmans  <[email protected]>

	* win/tclWinPort.h:    [Bug 3388350]: mingw64 compiler warnings
	* win/tclWinPipe.c
	* win/tclWinSock.c
	* win/configure.in
	* win/configure
	* generic/tclPosixStr.c
	* generic/tclStrToD.c

2011-08-12  Don Porter  <[email protected]>

	* generic/tclPathObj.c:	[Bug 3389764]: Eliminate possibility that dup
	of a "path" value can create reference cycle.

2011-08-09  Jan Nijtmans  <[email protected]>

	* win/tclWinConsole.c: [Bug 3388350]: mingw64 compiler warnings
	* win/tclWinDde.c
	* win/tclWinPipe.c
	* win/tclWinSerial.c

2011-08-05  Kevin B. Kenny  <[email protected]>

	* generic/tclStrToD.c: [Bug 3386975]: Plugged a memory leak in
	double->string conversion.

2011-07-28  Don Porter  <[email protected]>

	* library/tzdata/Asia/Anadyr: Update to Olson's tzdata2011h
	* library/tzdata/Asia/Irkutsk:
	* library/tzdata/Asia/Kamchatka:
	* library/tzdata/Asia/Krasnoyarsk:
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	* library/tzdata/Europe/Samara:
	* library/tzdata/Europe/Volgograd:
	* library/tzdata/America/Kralendijk: (new)
	* library/tzdata/America/Lower_Princes: (new)

2011-07-21  Jan Nijtmans  <[email protected]>

	* win/tclWinPort.h: [Bug 3372130] Fix hypot math function with MSVC10

2011-07-19  Don Porter  <[email protected]>

	* generic/tclUtil.c:	[Bug 3371644] Repair failure to properly handle 
	* tests/util.test: (length == -1) scanning in TclConvertElement().

2011-07-15  Don Porter  <[email protected]>

	* generic/tclCompile.c: Avoid segfaults when RecordByteCodeStats()
	is called in a deleted interp.








|



|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
	* library/tzdata/Europe/Samara:
	* library/tzdata/Europe/Volgograd:
	* library/tzdata/America/Kralendijk: (new)
	* library/tzdata/America/Lower_Princes: (new)

2011-07-21  Jan Nijtmans  <[email protected]>

	* win/tclWinPort.h: [Bug 3372130]: Fix hypot math function with MSVC10

2011-07-19  Don Porter  <[email protected]>

	* generic/tclUtil.c:	[Bug 3371644]: Repair failure to properly handle
	* tests/util.test: (length == -1) scanning in TclConvertElement().

2011-07-15  Don Porter  <[email protected]>

	* generic/tclCompile.c: Avoid segfaults when RecordByteCodeStats()
	is called in a deleted interp.

Changes to generic/tclInterp.c.

4128
4129
4130
4131
4132
4133
4134













4135
4136
4137
4138
4139
4140
4141
	OPT_CMD, OPT_GRAN, OPT_VAL
    };
    Interp *iPtr = (Interp *) interp;
    int index;
    ScriptLimitCallbackKey key;
    ScriptLimitCallback *limitCBPtr;
    Tcl_HashEntry *hPtr;














    if (objc == consumedObjc) {
	Tcl_Obj *dictPtr;

	TclNewObj(dictPtr);
	key.interp = slaveInterp;
	key.type = TCL_LIMIT_COMMANDS;







>
>
>
>
>
>
>
>
>
>
>
>
>







4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
	OPT_CMD, OPT_GRAN, OPT_VAL
    };
    Interp *iPtr = (Interp *) interp;
    int index;
    ScriptLimitCallbackKey key;
    ScriptLimitCallback *limitCBPtr;
    Tcl_HashEntry *hPtr;

    /*
     * First, ensure that we are not reading or writing the calling
     * interpreter's limits; it may only manipulate its children. Note that
     * the low level API enforces this with Tcl_Panic, which we want to
     * avoid. [Bug 3398794]
     */

    if (interp == slaveInterp) {
	Tcl_AppendResult(interp,
		"limits on current interpreter inaccessible", NULL);
	return TCL_ERROR;
    }

    if (objc == consumedObjc) {
	Tcl_Obj *dictPtr;

	TclNewObj(dictPtr);
	key.interp = slaveInterp;
	key.type = TCL_LIMIT_COMMANDS;
4299
4300
4301
4302
4303
4304
4305













4306
4307
4308
4309
4310
4311
4312
	OPT_CMD, OPT_GRAN, OPT_MILLI, OPT_SEC
    };
    Interp *iPtr = (Interp *) interp;
    int index;
    ScriptLimitCallbackKey key;
    ScriptLimitCallback *limitCBPtr;
    Tcl_HashEntry *hPtr;














    if (objc == consumedObjc) {
	Tcl_Obj *dictPtr;

	TclNewObj(dictPtr);
	key.interp = slaveInterp;
	key.type = TCL_LIMIT_TIME;







>
>
>
>
>
>
>
>
>
>
>
>
>







4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
	OPT_CMD, OPT_GRAN, OPT_MILLI, OPT_SEC
    };
    Interp *iPtr = (Interp *) interp;
    int index;
    ScriptLimitCallbackKey key;
    ScriptLimitCallback *limitCBPtr;
    Tcl_HashEntry *hPtr;

    /*
     * First, ensure that we are not reading or writing the calling
     * interpreter's limits; it may only manipulate its children. Note that
     * the low level API enforces this with Tcl_Panic, which we want to
     * avoid. [Bug 3398794]
     */

    if (interp == slaveInterp) {
	Tcl_AppendResult(interp,
		"limits on current interpreter inaccessible", NULL);
	return TCL_ERROR;
    }

    if (objc == consumedObjc) {
	Tcl_Obj *dictPtr;

	TclNewObj(dictPtr);
	key.interp = slaveInterp;
	key.type = TCL_LIMIT_TIME;

Changes to tests/interp.test.

3425
3426
3427
3428
3429
3430
3431







3432
3433
3434
3435
3436
3437
3438
test interp-35.22 {interp time limits normalize milliseconds} -body {
    set i [interp create]
    interp limit $i time -seconds 1 -millis 1500
    list [$i limit time -seconds] [$i limit time -millis]
} -cleanup {
    interp delete $i
} -result {2 500}








test interp-36.1 {interp bgerror syntax} -body {
    interp bgerror
} -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"}
test interp-36.2 {interp bgerror syntax} -body { 
    interp bgerror x y z
} -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"}







>
>
>
>
>
>
>







3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
test interp-35.22 {interp time limits normalize milliseconds} -body {
    set i [interp create]
    interp limit $i time -seconds 1 -millis 1500
    list [$i limit time -seconds] [$i limit time -millis]
} -cleanup {
    interp delete $i
} -result {2 500}
# Bug 3398794
test interp-35.23 {interp command limits can't touch current interp} -body {
    interp limit {} commands -value 10
} -returnCodes error -result {limits on current interpreter inaccessible}
test interp-35.24 {interp time limits can't touch current interp} -body {
    interp limit {} time -seconds 2
} -returnCodes error -result {limits on current interpreter inaccessible}

test interp-36.1 {interp bgerror syntax} -body {
    interp bgerror
} -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"}
test interp-36.2 {interp bgerror syntax} -body { 
    interp bgerror x y z
} -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"}