diff options
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r-- | generic/tclCompile.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index f62ec14..af86ba6 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1255,8 +1255,14 @@ Tcl_NRSubstObj( { ByteCode *codePtr = CompileSubstObj(interp, objPtr, flags); - /* TODO: Confirm we do not need this. */ - /* Tcl_ResetResult(interp); */ + /* + * Shortcut for empty scripts; avoid computing a string rep + */ + + if (objPtr->bytes && (*objPtr->bytes == '\0')) { + return TCL_OK; + } + return TclNRExecuteByteCode(interp, codePtr); } |