Tcl Source Code

Changes On Branch bug-bc1a96407a
Login

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

Changes In Branch bug-bc1a96407a Excluding Merge-Ins

This is equivalent to a diff from 32edfe9722 to c812d55777

2014-10-03
20:20
fix [bc1a96407a] check-in: d7030fb605 user: dgp tags: trunk
15:47
test cases Closed-Leaf check-in: c812d55777 user: dgp tags: bug-bc1a96407a
2014-10-02
21:40
Possible fix for testing. check-in: 7bc07a4974 user: dgp tags: bug-bc1a96407a
17:43
[bc1a96407a] Partial solution should avoid crash, but may lead to wrong behavior. check-in: 6c9efd94aa user: dgp tags: bug-bc1a96407a
14:51
merge trunk check-in: a20825f456 user: dgp tags: novem
14:46
[bc5b790099] Improper calculation of new dstLimit value. New test io-12.7. check-in: 32edfe9722 user: dgp tags: trunk
14:43
[bc5b790099] Improper calculation of new dstLimit value. New test io-12.7. check-in: df382f0bf1 user: dgp tags: core-8-5-branch
2014-09-27
21:36
Backing out commit [cddbfc3081], fix for bug [82521bfb6734f891dd]

The "optimisation" in that commit... check-in: 956d1be41b user: msofer tags: trunk


Changes to generic/tclCompCmds.c.

297
298
299
300
301
302
303

304
305
306
307
308
309
310
311
    }

    /*
     * Except for the special "ensure array" case below, when we're not in
     * a proc, we cannot do a better compile than generic.
     */


    if (envPtr->procPtr == NULL && !(isDataEven && len == 0)) {
	code = TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
	goto done;
    }

    PushVarNameWord(interp, varTokenPtr, envPtr, TCL_NO_ELEMENT,
	    &localIndex, &isScalar, 1);
    if (!isScalar) {







>
|







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
    }

    /*
     * Except for the special "ensure array" case below, when we're not in
     * a proc, we cannot do a better compile than generic.
     */

    if ((varTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) ||
	    (envPtr->procPtr == NULL && !(isDataEven && len == 0))) {
	code = TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
	goto done;
    }

    PushVarNameWord(interp, varTokenPtr, envPtr, TCL_NO_ELEMENT,
	    &localIndex, &isScalar, 1);
    if (!isScalar) {
338
339
340
341
342
343
344
345
346

347
348
349
350
351
352
353
    }

    if (localIndex < 0) {
	/*
	 * a non-local variable: upvar from a local one! This consumes the
	 * variable name that was left at stacktop.
	 */
	
	localIndex = AnonymousLocal(envPtr);

	PushStringLiteral(envPtr, "0");
	TclEmitInstInt4(INST_REVERSE, 2,        		envPtr);
	TclEmitInstInt4(INST_UPVAR, localIndex, 		envPtr);
	TclEmitOpcode(INST_POP,          			envPtr);
    }
    
    /*







|
|
>







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
    }

    if (localIndex < 0) {
	/*
	 * a non-local variable: upvar from a local one! This consumes the
	 * variable name that was left at stacktop.
	 */

	localIndex = TclFindCompiledLocal(varTokenPtr->start,
		varTokenPtr->size, 1, envPtr);
	PushStringLiteral(envPtr, "0");
	TclEmitInstInt4(INST_REVERSE, 2,        		envPtr);
	TclEmitInstInt4(INST_UPVAR, localIndex, 		envPtr);
	TclEmitOpcode(INST_POP,          			envPtr);
    }
    
    /*

Changes to generic/tclTrace.c.

2507
2508
2509
2510
2511
2512
2513



2514
2515
2516
2517
2518
2519
2520
				 * NULL. */
{
    const char *part1, *part2;

    if (!part1Ptr) {
	part1Ptr = localName(iPtr->varFramePtr, index);
    }



    part1 = TclGetString(part1Ptr);
    part2 = part2Ptr? TclGetString(part2Ptr) : NULL;

    return TclCallVarTraces(iPtr, arrayPtr, varPtr, part1, part2, flags,
	    leaveErrMsg);
}








>
>
>







2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
				 * NULL. */
{
    const char *part1, *part2;

    if (!part1Ptr) {
	part1Ptr = localName(iPtr->varFramePtr, index);
    }
    if (!part1Ptr) {
	Tcl_Panic("Cannot trace a variable with no name");
    }
    part1 = TclGetString(part1Ptr);
    part2 = part2Ptr? TclGetString(part2Ptr) : NULL;

    return TclCallVarTraces(iPtr, arrayPtr, varPtr, part1, part2, flags,
	    leaveErrMsg);
}

Changes to tests/var.test.

861
862
863
864
865
866
867











868
869
870
871
872
873
874
    unset -nocomplain x
} -body {
    apply {{} {
	eval {array set ::x {}}
    }}
    array size x
} -result 0












test var-21.0 {PushVarNameWord OBOE in compiled unset} -setup {
    proc linenumber {} {dict get [info frame -1] line}
} -body {
    apply {n {
	set foo bar
        unset foo {*}{







>
>
>
>
>
>
>
>
>
>
>







861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
    unset -nocomplain x
} -body {
    apply {{} {
	eval {array set ::x {}}
    }}
    array size x
} -result 0
test var-20.9 {[bc1a96407a] array set compiled w/ trace} {
    variable foo
    lappend lambda {}
    lappend lambda [list array set [namespace which -variable foo] {a 1}]
    after 0 [list apply $lambda]
    vwait [namespace which -variable foo]
    unset -nocomplain lambda foo
} {}
test var-20.10 {[bc1a96407a] array set don't compile bad varname} -body {
    apply {{} {set name foo(bar); array set $name {a 1}}}
} -returnCodes error -match glob -result *

test var-21.0 {PushVarNameWord OBOE in compiled unset} -setup {
    proc linenumber {} {dict get [info frame -1] line}
} -body {
    apply {n {
	set foo bar
        unset foo {*}{