Tcl Source Code

Check-in [6b81a0d7de]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:[d87cb18205] Let compiled ensembles handle tailcalls properly.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6b81a0d7de591ac97a1ec26d3fff4f75ddb00d73
User & Date: dgp 2015-03-21 00:31:29
Context
2015-03-21
15:08
adding a test to reveal a problem with the fix of bug d87cb182053fd79b3 check-in: 76751aba52 user: msofer tags: trunk
00:31
[d87cb18205] Let compiled ensembles handle tailcalls properly. check-in: 6b81a0d7de user: dgp tags: trunk
2015-03-20
19:57
Remove STRICT directive from public header. It does approximately nothing, and doesn't belong in ge... check-in: 806e97f718 user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclExecute.c.

3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
	iPtr->ensembleRewrite.numRemovedObjs = opnd;
	iPtr->ensembleRewrite.numInsertedObjs = 1;
	DECACHE_STACK_INFO();
	pc += 6;
	TEBC_YIELD();

	TclNRAddCallback(interp, TclClearRootEnsemble, NULL,NULL,NULL,NULL);
	TclSkipTailcall(interp);
	return TclNREvalObjEx(interp, objPtr, TCL_EVAL_INVOKE, NULL, INT_MIN);

    /*
     * -----------------------------------------------------------------
     *	   Start of INST_LOAD instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different






<







3182
3183
3184
3185
3186
3187
3188

3189
3190
3191
3192
3193
3194
3195
	iPtr->ensembleRewrite.numRemovedObjs = opnd;
	iPtr->ensembleRewrite.numInsertedObjs = 1;
	DECACHE_STACK_INFO();
	pc += 6;
	TEBC_YIELD();

	TclNRAddCallback(interp, TclClearRootEnsemble, NULL,NULL,NULL,NULL);

	return TclNREvalObjEx(interp, objPtr, TCL_EVAL_INVOKE, NULL, INT_MIN);

    /*
     * -----------------------------------------------------------------
     *	   Start of INST_LOAD instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different

Changes to tests/nre.test.

146
147
148
149
150
151
152





















153
154
155
156
157
158
159
    a 0
} -cleanup {
    rename a {}
    rename b {}
} -constraints {
    testnrelevels
} -result {{0 2 1 1} 0}






















test nre-5.1 {[namespace eval] is not recursive} -setup {
    namespace eval ::foo {
	setabs
    }
    proc foo::a i [makebody {namespace eval ::foo [list a $i]}]
} -body {






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







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    a 0
} -cleanup {
    rename a {}
    rename b {}
} -constraints {
    testnrelevels
} -result {{0 2 1 1} 0}

test nre-4.2 {(compiled) ensembles do not break tailcall} -setup {
    # Fix Bug d87cb18205
    proc b {} {
	tailcall append result first
    }
    set map [namespace ensemble configure ::dict -map]
    dict set map a b
    namespace ensemble configure ::dict -map $map
    proc demo {} {
	dict a
	append result second
    }
} -body {
    demo
} -cleanup {
    rename demo {}
    namespace ensemble configure ::dict -map [dict remove $map a]
    unset map
    rename b {}
} -result firstsecond

test nre-5.1 {[namespace eval] is not recursive} -setup {
    namespace eval ::foo {
	setabs
    }
    proc foo::a i [makebody {namespace eval ::foo [list a $i]}]
} -body {