View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] error not taken in account in init instproc

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Thu, 24 Feb 2005 02:20:17 +0100

Dear Fabrice,

thanks for noting; the bug is confirmed.

Apply this small patch to fix it. We will change the package require
to return the full verison number as well in the next version.

happy xotickling
-gustaf neumann


--- generic/xotcl.c-orig Thu Feb 24 02:04:31 2005
+++ generic/xotcl.c Thu Feb 24 02:11:32 2005
_at_@ -6391,7 +6391,9 @@
     obj->flags |= XOTCL_INIT_CALLED;
   }
 
- Tcl_SetObjResult(in, savedObjResult);
+ if (result == TCL_OK) {
+ Tcl_SetObjResult(in, savedObjResult);
+ }
   DECR_REF_COUNT(savedObjResult);
 
   return result;



Fabrice Pardo schrieb:

>The errors seems not to be taken in account in "init" instproc:
>
>Class create C
>C instproc init {e} {
> if {$e} {error "an error"}
> next
>}
>C create o1 1 ;# ::o1
>set errorInfo ;# an error...while executing...
>C create o1 1 ;# now a blank line !
>C create o2 ;# ::o2
>set errorInfo ;# wrong # args: should be "init e" ...
>
># Program version:
>info patchlevel ;# 8.4.8
>package ifneeded XOTcl 1.3.3 ;# load /.../libxotcl1.3.3.so XOTcl
>
>
>