[49206] trunk/base/src/tclobjc1.0/objc_encoding.m

toby at macports.org toby at macports.org
Sun Apr 5 03:44:14 PDT 2009


Revision: 49206
          http://trac.macports.org/changeset/49206
Author:   toby at macports.org
Date:     2009-04-05 03:44:14 -0700 (Sun, 05 Apr 2009)
Log Message:
-----------
Don't crash due to a type conversion error.

Modified Paths:
--------------
    trunk/base/src/tclobjc1.0/objc_encoding.m

Modified: trunk/base/src/tclobjc1.0/objc_encoding.m
===================================================================
--- trunk/base/src/tclobjc1.0/objc_encoding.m	2009-04-05 10:34:50 UTC (rev 49205)
+++ trunk/base/src/tclobjc1.0/objc_encoding.m	2009-04-05 10:44:14 UTC (rev 49206)
@@ -48,7 +48,6 @@
 #include "tclobjc_types.h"
 
 int objc_to_tclobj(Tcl_Interp *interp, Tcl_Obj **objPtr, const char *type, void *val) {
-	Tcl_Obj *tcl_result;
 	char *name;
 
 	switch(*type) {
@@ -65,11 +64,8 @@
 			return (TCL_OK);
 		default:
 			/* Unhandled objc type encoding */
-			if (interp) {
-				tcl_result = Tcl_NewStringObj("Invalid objc type encoding: ", -1);
-				Tcl_AppendToObj(tcl_result, type, -1);
-				Tcl_SetObjResult(interp, tcl_result);
-			}
+			*objPtr = Tcl_NewStringObj("Invalid objc type encoding: ", -1);
+			Tcl_AppendToObj(*objPtr, type, -1);
 			return (TCL_ERROR);
 	}
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090405/0d07fb8b/attachment.html>


More information about the macports-changes mailing list