summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-09-03 19:52:01 (GMT)
committerhobbs <hobbs>2002-09-03 19:52:01 (GMT)
commitf877edf4105f60b343f31b940ab575a2ce0e78ad (patch)
treebc6a878a86b02313d228cb8725ce72888e78d772 /generic
parent6af3ee59635ce3a2101b7394f3e74773d6bb62d4 (diff)
downloadtcl-f877edf4105f60b343f31b940ab575a2ce0e78ad.zip
tcl-f877edf4105f60b343f31b940ab575a2ce0e78ad.tar.gz
tcl-f877edf4105f60b343f31b940ab575a2ce0e78ad.tar.bz2
(Tcl_UpVar2): code cleanup to not use goto
Diffstat (limited to 'generic')
-rw-r--r--generic/tclVar.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 26a1bc2..516a558 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.64 2002/09/03 15:04:42 msofer Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.65 2002/09/03 19:52:01 hobbs Exp $
*/
#include "tclInt.h"
@@ -3639,19 +3639,16 @@ Tcl_UpVar2(interp, frameName, part1, part2, localName, flags)
CallFrame *framePtr;
Tcl_Obj *part1Ptr;
+ if (TclGetFrame(interp, frameName, &framePtr) == -1) {
+ return TCL_ERROR;
+ }
+
part1Ptr = Tcl_NewStringObj(part1, -1);
Tcl_IncrRefCount(part1Ptr);
-
- result = TclGetFrame(interp, frameName, &framePtr);
- if (result == -1) {
- result = TCL_ERROR;
- goto done;
- }
result = ObjMakeUpvar(interp, framePtr, part1Ptr, part2, 0,
localName, flags, -1);
-
- done:
TclDecrRefCount(part1Ptr);
+
return result;
}