gimp r26943 - in trunk: . plug-ins/script-fu/tinyscheme



Author: kcozens
Date: Sun Sep 14 22:59:06 2008
New Revision: 26943
URL: http://svn.gnome.org/viewvc/gimp?rev=26943&view=rev

Log:
2008-09-14  Kevin Cozens  <kcozens cvs gnome org>

	* plug-ins/script-fu/tinyscheme/scheme.c (mk_vector), (opexe_2):
	Applied changes from official version of TinyScheme which adds
	tests for when mk_vector is out of memory. Can't rely on sc->sink.


Modified:
   trunk/ChangeLog
   trunk/plug-ins/script-fu/tinyscheme/scheme.c

Modified: trunk/plug-ins/script-fu/tinyscheme/scheme.c
==============================================================================
--- trunk/plug-ins/script-fu/tinyscheme/scheme.c	(original)
+++ trunk/plug-ins/script-fu/tinyscheme/scheme.c	Sun Sep 14 22:59:06 2008
@@ -1026,6 +1026,7 @@
 
 INTERFACE static pointer mk_vector(scheme *sc, int len) {
      pointer x=get_consecutive_cells(sc,len/2+len%2+1);
+     if(sc->no_memory) { return sc->sink; }
      typeflag(x) = (T_VECTOR | T_ATOM);
      ivalue_unchecked(x)=len;
      set_num_integer(x);
@@ -3443,6 +3444,7 @@
                Error_1(sc,"vector: not a proper list:",sc->args);
           }
           vec=mk_vector(sc,len);
+          if(sc->no_memory) { s_return(sc, sc->sink); }
           for (x = sc->args, i = 0; is_pair(x); x = cdr(x), i++) {
                set_vector_elem(vec,i,car(x));
           }
@@ -3460,6 +3462,7 @@
                fill=cadr(sc->args);
           }
           vec=mk_vector(sc,len);
+          if(sc->no_memory) { s_return(sc, sc->sink); }
           if(fill!=sc->NIL) {
                fill_vector(vec,fill);
           }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]