summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve fix and add test.bug_4b61afd660dgp2016-06-161-5/+2
|
* Corrects reported bug, but makes many tests fail. Something subtle aboutdgp2016-06-101-0/+4
| | | | what we should expect when recording the line of a command that isn't known until runtime.
* [e711ffb458] Replace TclIsLocalScalar() (which does the wrong thing).... withdgp2014-12-091-2/+2
| | | PushVarNameWord() (which doesn't) in the compiler for [dict lappend].
* TclCompileScript() should not overwrite envPtr->numSrcBytes.dgp2013-06-201-1/+0
| | | The envPtr already has the right value stored in it.
* Remove from tclCompile.h declarations used in only one source file.dgp2013-03-051-5/+6
|
* Restore the ReleaseCmdWordData cleanup routine from 8.4, to plug verydgp2013-02-221-18/+26
| | | rare memory leak.
*-. Shift more burden of smart cleanup onto the TclFreeCompileEnv() routine.dgp2013-02-221-30/+43
|\ \ | | | | | | Stop crashes when the hookProc raises an error.
| | * Use iPtr field instead of source field to mark a CompileEnv as uninitialized.dgp2013-02-221-4/+4
| |/ | | | | envPtr->source == NULL can actually be valid (at least when merging forward).
| * Protect against multiple uses of a CompileEnv with only one initialization.dgp2013-02-211-31/+43
| | | | | | | | | | Make TclFreeCompileEnv smarter about cleanup so all callers do not have to be. Revise TclSetByteCodeFromAny() so that when hookProc raises an error, bytecode is not generated. This was rumored to cause crashes.
| * make some more internal tables constjan.nijtmans2012-04-231-1/+1
| | | | | | On cygwin, install dll's in /usr/bin, not in /usr/lib
* | Use twoPtrValue.ptr1 in stead of otherValuePtr everywhere. This is exactly ↵jan.nijtmans2013-01-311-7/+5
| | | | | | | | the same field, but it allows twoPtrValue.ptr2 to be used for other purposes.
* | some formatting (*.decls)jan.nijtmans2012-04-041-1/+1
|\ \ | |/ | | | | | | move up #undef, for macro which is conflicting with later stuff. remove some unused cygwin-related code some minor gcc warnings
* | Fix: Removed C99ism (in-block variable declaration) from commit [39f6ebe301] ↵andreask2012-02-171-1/+3
| | | | | | | | which prevents building with non-gcc compilers, notably AIX, HPUX, Solaris, MSVC6, possibly others.
* | bug fix: avoid segfaulting by deleted interp in RecordByteCodeStatssebres2012-02-171-2/+1
| |
* | Avoid segfaults when RecordByteCodeStats() is called in a deleted interp.dgp2011-07-151-0/+5
|\ \ | |/
| * Avoid segfaults when RecordByteCodeStats() is called in a deleted interp.dgp2011-07-151-0/+5
| |
| * wipdgp2011-07-121-6/+6
| |
| * Type mismatches in *printf calls.dgp2011-07-111-2/+2
| |
* | silence compiler warningdgp2011-05-251-1/+1
| |
* | * generic/tclCompile.c (TclFixupForwardJump): Tracked down and fixedandreask2011-05-171-0/+64
| | | | | | | | | | | | | | | | | | * generic/tclBasic.c (TclArgumentBCEnter): the cause of a violation of my assertion that 'ePtr->nline == objc' in TclArgumentBCEnter. When a bytecode was grown during jump fixup the pc -> command line mapping was not updated. When things aligned just wrong the mapping would direct command A to the data for command B, with a different number of arguments.
* | Make sure SetFooFromAny routines react reasonably when passed a NULL interp.dgp2011-04-211-2/+6
|\ \ | |/
| * Make sure SetFooFromAny routines react reasonably when passed a NULL interp.dgp2011-04-211-2/+5
| |
* | * generic/tclBasic.c: More replacements of Tcl_UtfBackslash() callsdgp2011-03-061-3/+5
|\ \ | |/ | | | | | | * generic/tclCompile.c: with TclParseBackslash() where possible. * generic/tclParse.c: * generic/tclUtil.c:
| * * generic/tclBasic.c: More replacements of Tcl_UtfBackslash() callsdgp2011-03-061-2/+2
| | | | | | | | | | | | * generic/tclCmdMZ.c: with TclParseBackslash() where possible. * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclUtil.c:
* | Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
|\ \ | |/ | | more harm than good. Purged them.
| * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| | | | | | more harm than good. Purged them.
| * * generic/tclCompile.c: [Bug 2949302]: Fixed leak of supportandreas_kupries2010-02-111-18/+47
| | | | | | | | | | structures for [info frame] which occured when bytecode compilation fails.
| * silence compiler warningsdgp2009-08-261-2/+2
| |
| * * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-13/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EvalTokensStandard, Tcl_EvalEx, EvalEx, TclAdvanceContinuations, TclEvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, ListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript): * generic/tclCompile.h (CompileEnv): * generic/tclInt.h (ContLineLoc, Interp): * generic/tclObj.c (ThreadSpecificData, ContLineLocFree, TclThreadFinalizeObjects, TclInitObjSubsystem, TclContinuationsEnter, TclContinuationsEnterDerived, TclContinuationsCopy, TclContinuationsGet, TclFreeObj): * generic/tclProc.c (TclCreateProc): * generic/tclVar.c (TclPtrSetVar): * tests/info.test (info-30.0-22): Extended parser, compiler, and execution with code and attendant data structures tracking the positions of continuation lines which are not visible in script's, to properly account for them while counting lines for #280, during direct and compiled execution.
| * * generic/tclBasic.c (DeleteInterpProc,TclArgumentBCEnter,andreas_kupries2009-07-141-55/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclArgumentBCRelease, TclArgumentGet): * generic/tclCompile.c (EnterCmdWordIndex, TclCleanupByteCode, TclInitCompileEnv, TclCompileScript): * generic/tclCompile.h (ExtCmdLoc): * generic/tclExecute.c (TclExecuteByteCode): * generic/tclInt.h (ExtIndex, CFWordBC): * tests/info.test (info-39.0): Backport of some changes made to the Tcl head, to handle literal sharing better. The code here is much simpler (trimmed down) compared to the head as the 8.4 branch is not bytecode compiling whole files, and doesn't compile eval'd code either. Reworked the handling of literal command arguments in bytecode to be saved (compiler) and used (execution) per command (See the TCL_INVOKE_STK* instructions), and not per the whole bytecode. This removes the problems with location data caused by literal sharing in proc bodies. Simplified the associated datastructures (ExtIndex is gone, as is the function EnterCmdWordIndex).
| * * generic/tclCompile.c: The value stashed in iPtr->compiledProcPtrdgp2009-06-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclProc.c: when compiling a proc survives too long. We * tests/execute.test: only need it there long enough for the right TclInitCompileEnv() call to re-stash it into envPtr->procPtr. Once that is done, the CompileEnv controls. If we let the value of iPtr->compiledProcPtr linger, though, then any other bytecode compile operation that takes place will also have its CompileEnv initialized with it, and that's not correct. The value is meant to control the compile of the proc body only, not other compile tasks that happen along. Thanks to Carlos Tasada for discovering and reporting the problem. [Bug 2802881].
| * * generic/tclBasic.c: Added missing release of extended commandandreas_kupries2008-07-281-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | word index when deleting an interpreter (DeleteInterpProc). Added missing ref count when creating an empty string as path (EvalEx). * generic/tclCompile.c (TclInitCompileEnv): Made same change to control flow as in TclEvalObjEx. Not needed while uplevel and siblings go through the eval-direct code path, however if that changes (like it did in 8.5+) better to have this in place instead of re-searching why certain places are without absolute locations. * tests/info.test: Added tests 38.*, exactly testing the tracking of location for uplevel scripts, and made the testsuite fully usable with and without -singleproc 1.
| * * generic/tclBasic.c: Modified TclArgumentGet to reject pure listsandreas_kupries2008-07-231-3/+7
| | | | | | | | | | | | | | | | | | | | * generic/tclCmdIL.c: immediately, without search. Reworked setup * generic/tclCompile.c: of eoFramePtr, doesn't need the line * tests/info.test: information, more sensible to have everything on line 1 when eval'ing a pure list. Updated the users of the line information to special case this based on the frame type (i.e. TCL_LOCATION_EVAL_LIST). Added a testcase demonstrating the new behaviour.
| * * generic/tclCompile.c: Made the new TclEnterCmdWordIndexandreas_kupries2008-07-221-7/+10
| | | | | | | | * generic/tclCompile.h: static.
| * * generic/tclBasic.c: Reworked the handling of bytecode literalsandreas_kupries2008-07-221-16/+27
| | | | | | | | | | | | | | | | | | | | * generic/tclCompile.c: for #280 to fix the abysmal performance * generic/tclCompile.h: for deep recursion, replaced the linear * generic/tclExecute.c: search through the whole stack with * generic/tclInt.h: another hashtable and simplified the data structure used by the compiler (array instead of hashtable). Incidentially this also fixes the memory leak reported via [Bug 2024937].
| * * generic/tclBasic.c: Extended the existing TIP #280 system (infoandreas_kupries2008-07-211-1/+48
| | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdAH.c: frame), added the ability to track the * generic/tclCompCmds.c: absolute location of literal procedure * generic/tclCompile.c: arguments, and making this information * generic/tclCompile.h: available to uplevel, eval, and * generic/tclInterp.c: siblings. This allows proper tracking of * generic/tclInt.h: absolute location through custom (Tcl-coded) * generic/tclNamesp.c: control structures based on uplevel, etc. * generic/tclProc.c:
| * * generic/tclCompile.c: replaced copy loop that tripped someMiguel Sofer2007-08-241-5/+5
| | | | | | | | compilers with memmove [Bug 1780870]
| * * generic/tclBasic.c: TIP #280 implementation, conditional on the define ↵andreas_kupries2006-11-281-5/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TCL_TIP280. * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclInt.h: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclProc.c: * tests/compile.test: * tests/info.test: * tests/platform.test: * tests/safe.test:
| * * generic/tclCompile.c: handle warning [Bug 969066]Miguel Sofer2004-06-081-2/+6
| |
| * * generic/tclCompile.c (TclCompileScript): corrected possibleMiguel Sofer2004-03-291-3/+4
| | | | | | | | | | segfault when a compilation returns TCL_OUTLINE_COMPILE after having grown the compile environment [Bug 925121].
| * * generic/tclCompile.c (TclCompileScript):Miguel Sofer2004-03-151-4/+6
| | | | | | | | | | | | | | | | | | * tests/compile.test (compile-3.5): corrected wrong test and behaviour in the earlier fix for [Bug 705406]; Don Porter reported this as [Bug 735055], and provided the solution. Fixed in HEAD on 2003-05-09, but backport to 8-4-branch was wrongly omitted; re-reported as [Bug 916795] by Roy Terry, diagnosed by dgp.
| * * generic/tclBasic.c: Corrected several instances of unsafedgp2003-07-181-1/+9
| | | | | | | | | | | | | | * generic/tclCompile.c: truncation of UTF-8 strings that might * generic/tclProc.c: break apart a multi-byte character. * library/init.tcl: [Bug 760872] * tests/init.test:
| * Corrected bogus commentsdgp2003-04-181-7/+2
| |
| * * generic/tclCompile.c:Miguel Sofer2003-03-191-2/+9
| | | | | | | | | | * tests/compile.test: bad command count on TCL_OUT_LINE_COMPILE [Bug 705406] (Don Porter). Backport from 8.5a0
* | * generic/tclCompile.c: [Bug 2933089]: A literal sharing problem withandreas_kupries2010-02-021-1/+3
| | | | | | | | | | | | * generic/tclCompile.h: 'info frame' affects not only 8.6 but 8.5 as * generic/tclExecute.h: well. Backported the fix done in 8.6, without * tests/info.test: changes. New testcase info-39.1.
* | silence compiler warningsdgp2009-08-261-2/+2
| |
* | * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-7/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EvalTokensStandard, Tcl_EvalEx, EvalEx, TclAdvanceContinuations, TclEvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, TclListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript): * generic/tclCompile.h (CompileEnv): * generic/tclInt.h (ContLineLoc, Interp): * generic/tclObj.c (ThreadSpecificData, ContLineLocFree, TclThreadFinalizeObjects, TclInitObjSubsystem, TclContinuationsEnter, TclContinuationsEnterDerived, TclContinuationsCopy, TclContinuationsGet, TclFreeObj): * generic/tclParse.c (TclSubstTokens, Tcl_SubstObj): * generic/tclProc.c (TclCreateProc): * generic/tclVar.c (TclPtrSetVar): * tests/info.test (info-30.0-24): Extended parser, compiler, and execution with code and attendant data structures tracking the positions of continuation lines which are not visible in script Tcl_Obj*'s, to properly account for them while counting lines for #280.
* | * generic/tclCmdIL.c: Removed unused variables.dgp2009-07-161-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.c: * generic/tclVar.c: * unix/tclUnixChan.c: * generic/tclScan.c: Typo in ACCEPT_NAN configuration. * generic/tclStrToD.c: Set floating point control register on MIPS systems so that the gradual underflow expected by Tcl is in effect. [Bug 2819200]
* | fix 64bit int <-> ptr cast warningsdas2009-07-151-2/+2
| |
* | * generic/tclBasic.c (DeleteInterpProc,TclArgumentBCEnter,andreas_kupries2009-07-141-51/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclArgumentBCRelease, TclArgumentGet): * generic/tclCompile.c (EnterCmdWordIndex, TclCleanupByteCode, TclInitCompileEnv, TclCompileScript): * generic/tclCompile.h (ExtCmdLoc): * generic/tclExecute.c (TclExecuteByteCode): * generic/tclInt.h (ExtIndex, CFWordBC): * tests/info.test (info-39.0): Backport of some changes made to the Tcl head, to handle literal sharing better. The code here is much simpler (trimmed down) compared to the head as the 8.5 branch is not bytecode compiling whole files, and doesn't compile eval'd code either. Reworked the handling of literal command arguments in bytecode to be saved (compiler) and used (execution) per command (See the TCL_INVOKE_STK* instructions), and not per the whole bytecode. This removes the problems with location data caused by literal sharing in proc bodies. Simplified the associated datastructures (ExtIndex is gone, as is the function EnterCmdWordIndex).