[Swfdec] 10 commits - libswfdec/js libswfdec/swfdec_js_color.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_video.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_script.c player/.gitignore test/.gitignore test/trace

Benjamin Otte company at kemper.freedesktop.org
Sun Mar 11 14:02:22 PDT 2007


 libswfdec/js/jsobj.c                          |   56 +++++++++++---------------
 libswfdec/swfdec_js_color.c                   |   14 ------
 libswfdec/swfdec_js_connection.c              |   14 ------
 libswfdec/swfdec_js_movie.c                   |   22 ----------
 libswfdec/swfdec_js_net_stream.c              |   14 ------
 libswfdec/swfdec_js_video.c                   |   14 ------
 libswfdec/swfdec_js_xml.c                     |   14 ------
 libswfdec/swfdec_script.c                     |   31 ++++++++------
 player/.gitignore                             |    3 +
 test/.gitignore                               |    3 +
 test/trace/Makefile.am                        |    9 +++-
 test/trace/callfunction-stack.as              |   44 ++++++++++++++++++++
 test/trace/callfunction-stack.swf             |binary
 test/trace/callfunction-stack.swf.trace       |   14 ++++++
 test/trace/empty-stack.as                     |    7 +++
 test/trace/empty-stack.swf                    |binary
 test/trace/empty-stack.swf.trace              |    2 
 test/trace/registerclass-properties.swf       |binary
 test/trace/registerclass-properties.swf.trace |    7 +++
 19 files changed, 132 insertions(+), 136 deletions(-)

New commits:
diff-tree 03fccd9bc1924e4e128d1d0d6454a867991fd623 (from e292885e16290e586530b908886e26b2dd68506b)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 22:02:27 2007 +0100

    add test for various stack underruns with ActionCallFunction

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 176c34f..7b65208 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -11,6 +11,9 @@ EXTRA_DIST = \
 	README \
 	array.swf \
 	array.swf.trace \
+	callfunction-stack.as \
+	callfunction-stack.swf \
+	callfunction-stack.swf.trace \
 	case1-6.swf \
 	case1-6.swf.trace \
 	case1-7.swf \
diff --git a/test/trace/callfunction-stack.as b/test/trace/callfunction-stack.as
new file mode 100644
index 0000000..9f35094
--- /dev/null
+++ b/test/trace/callfunction-stack.as
@@ -0,0 +1,44 @@
+// /usr/bin/makeswf -s 200x150 -o callfunction-stack.swf callfunction-stack.as
+
+trace ("Check that function calls using empty stack work as expected");
+function foo () {
+  trace (arguments.length);
+  for (i = 0; i < arguments.length; i++) {
+    trace (arguments[i]);
+  };
+}
+asm {
+  push 5, "foo"
+  callfunction
+  pop
+};
+asm {
+  push 1, 2, 3, 5, "foo"
+  callfunction
+  pop
+};
+asm {
+  push 1, 2, 5, "foo"
+  callfunction
+  pop
+};
+asm {
+  push "foo"
+  callfunction
+  pop
+};
+asm {
+  push "hi", "foo"
+  callfunction
+  pop
+};
+asm {
+  push 42, "+1", "foo"
+  callfunction
+  pop
+};
+asm {
+  push 268435455, "foo"
+  callfunction
+  pop
+};
diff --git a/test/trace/callfunction-stack.swf b/test/trace/callfunction-stack.swf
new file mode 100644
index 0000000..02fcd74
Binary files /dev/null and b/test/trace/callfunction-stack.swf differ
diff --git a/test/trace/callfunction-stack.swf.trace b/test/trace/callfunction-stack.swf.trace
new file mode 100644
index 0000000..fe34ca0
--- /dev/null
+++ b/test/trace/callfunction-stack.swf.trace
@@ -0,0 +1,14 @@
+Check that function calls using empty stack work as expected
+0
+3
+3
+2
+1
+2
+2
+1
+0
+0
+1
+42
+0
diff-tree e292885e16290e586530b908886e26b2dd68506b (from a1bebe73d820da7a562c351d1d535a4b8761e163)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 21:51:06 2007 +0100

    fix handling of missing arguments to be in line with the official player

diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 2860e24..4b17af1 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -650,8 +650,16 @@ swfdec_action_call (JSContext *cx, guint
   JSStackFrame *fp = cx->fp;
   int i, j;
   jsval tmp;
+  guint stacksize;
 
-  g_assert ((guint) (fp->sp - fp->spbase) >= n_args + 2);
+  stacksize = fp->sp - fp->spbase;
+  g_assert (stacksize >= 2);
+  if (n_args + 2 > stacksize) {
+    SWFDEC_WARNING ("broken script. Want %u arguments, only got %u", n_args, stacksize - 2);
+    n_args = stacksize - 2;
+    if (!swfdec_script_ensure_stack (cx, n_args + 2))
+      return JS_FALSE;
+  }
 
   j = -1;
   i = - (n_args + 2);
@@ -677,13 +685,13 @@ swfdec_action_call_function (JSContext *
   jsval fun;
   JSAtom *atom;
   
+  if (!swfdec_script_ensure_stack (cx, 2))
+    return JS_FALSE;
   s = swfdec_js_to_string (cx, fp->sp[-1]);
   if (s == NULL)
     return JS_FALSE;
   if (!JS_ValueToECMAUint32 (cx, fp->sp[-2], &n_args))
     return JS_FALSE;
-  if (!swfdec_script_ensure_stack (cx, n_args + 2))
-    return JS_FALSE;
   
   if (!(atom = js_Atomize (cx, s, strlen (s), 0)) ||
       !js_FindProperty (cx, (jsid) atom, &obj, &pobj, &prop))
@@ -709,13 +717,13 @@ swfdec_action_call_method (JSContext *cx
   JSObject *obj;
   jsval fun;
   
+  if (!swfdec_script_ensure_stack (cx, 3))
+    return JS_FALSE;
   s = swfdec_js_to_string (cx, fp->sp[-1]);
   if (s == NULL)
     return JS_FALSE;
   if (!JS_ValueToECMAUint32 (cx, fp->sp[-3], &n_args))
     return JS_FALSE;
-  if (!swfdec_script_ensure_stack (cx, n_args + 3))
-    return JS_FALSE;
   
   if (!JS_ValueToObject (cx, fp->sp[-2], &obj))
     return JS_FALSE;
@@ -1439,16 +1447,14 @@ swfdec_action_new_object (JSContext *cx,
   guint n_args;
   const char *name;
 
+  if (!swfdec_script_ensure_stack (cx, 2))
+    return JS_FALSE;
   constructor = fp->sp[-1];
   name = swfdec_eval_jsval (cx, NULL, &constructor);
   if (name == NULL)
     return JS_FALSE;
   if (!JS_ValueToECMAUint32 (cx, fp->sp[-2], &n_args))
     return JS_FALSE;
-  if (!swfdec_script_ensure_stack (cx, n_args + 2)) {
-    SWFDEC_ERROR ("not enough stack space");
-    return JS_FALSE;
-  }
   if (constructor == JSVAL_VOID) {
     SWFDEC_WARNING ("no constructor for %s", name);
   }
@@ -1479,13 +1485,13 @@ swfdec_action_new_method (JSContext *cx,
   JSObject *object;
   jsval constructor;
   
+  if (!swfdec_script_ensure_stack (cx, 3))
+    return JS_FALSE;
   s = swfdec_js_to_string (cx, fp->sp[-1]);
   if (s == NULL)
     return JS_FALSE;
   if (!JS_ValueToECMAUint32 (cx, fp->sp[-3], &n_args))
     return JS_FALSE;
-  if (!swfdec_script_ensure_stack (cx, n_args + 3))
-    return JS_FALSE;
   
   if (!JS_ValueToObject (cx, fp->sp[-2], &object))
     return JS_FALSE;
diff-tree a1bebe73d820da7a562c351d1d535a4b8761e163 (from 51200b6ad86eb55b04552d3ab729f17706d5c8f2)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 20:00:27 2007 +0100

    add file used to generate empty-stack test with ming

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 9547cef..176c34f 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -51,6 +51,7 @@ EXTRA_DIST = \
 	currentframe.swf.trace \
 	double.swf \
 	event-order.swf \
+	empty-stack.as \
 	empty-stack.swf \
 	empty-stack.swf.trace \
 	event-order.swf.trace \
diff --git a/test/trace/empty-stack.as b/test/trace/empty-stack.as
new file mode 100755
index 0000000..ff1064e
--- /dev/null
+++ b/test/trace/empty-stack.as
@@ -0,0 +1,7 @@
+// /usr/bin/makeswf -s 200x150 -o empty-stack.swf empty-stack.as
+
+trace ("Check that the empty stack is treated as unlimited undefined values");
+asm {
+  pop
+  trace
+};
diff-tree 51200b6ad86eb55b04552d3ab729f17706d5c8f2 (from 95b30a49dd3382b1715f48f40a816be986e93a39)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 19:48:59 2007 +0100

    actually adjust the stack pointer after adjusting the stack (d'oh)

diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 8c24c5d..2860e24 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -154,6 +154,7 @@ swfdec_script_ensure_stack (JSContext *c
     n_elements -= current;
     memmove (fp->spbase + n_elements, fp->spbase, (fp->sp - fp->spbase) * sizeof (jsval));
   }
+  fp->sp += n_elements;
   while (n_elements)  {
     n_elements--;
     fp->spbase[n_elements] = JSVAL_VOID;
diff-tree 95b30a49dd3382b1715f48f40a816be986e93a39 (from adc3fb06dadf41c2600d64a5735eafa85baa3064)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 18:25:11 2007 +0100

    add test for empty stack treatment

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 8c7774e..9547cef 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -50,8 +50,9 @@ EXTRA_DIST = \
 	currentframe.swf \
 	currentframe.swf.trace \
 	double.swf \
-	double.swf.trace \
 	event-order.swf \
+	empty-stack.swf \
+	empty-stack.swf.trace \
 	event-order.swf.trace \
 	function1.swf \
 	function1.swf.trace \
diff --git a/test/trace/empty-stack.swf b/test/trace/empty-stack.swf
new file mode 100644
index 0000000..d221934
Binary files /dev/null and b/test/trace/empty-stack.swf differ
diff --git a/test/trace/empty-stack.swf.trace b/test/trace/empty-stack.swf.trace
new file mode 100644
index 0000000..7f5daa2
--- /dev/null
+++ b/test/trace/empty-stack.swf.trace
@@ -0,0 +1,2 @@
+Check that the empty stack is treated as unlimited undefined values
+undefined
diff-tree adc3fb06dadf41c2600d64a5735eafa85baa3064 (from 233a6b1a0af55296a6c7b536e9310b6fb1c7e46d)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 16:23:43 2007 +0100

    add a new test

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 69b995a..8c7774e 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -113,6 +113,8 @@ EXTRA_DIST = \
 	preload.swf.trace \
 	prototypes.swf \
 	prototypes.swf.trace \
+	registerclass-properties.swf \
+	registerclass-properties.swf.trace \
 	rotation-5.swf \
 	rotation-5.swf.trace \
 	scope.swf \
diff --git a/test/trace/registerclass-properties.swf b/test/trace/registerclass-properties.swf
new file mode 100755
index 0000000..a4f0f47
Binary files /dev/null and b/test/trace/registerclass-properties.swf differ
diff --git a/test/trace/registerclass-properties.swf.trace b/test/trace/registerclass-properties.swf.trace
new file mode 100755
index 0000000..c803228
--- /dev/null
+++ b/test/trace/registerclass-properties.swf.trace
@@ -0,0 +1,7 @@
+Check properties after a registerClass
+true
+hi
+_level0.movie
+undefined
+50
+movie
diff-tree 233a6b1a0af55296a6c7b536e9310b6fb1c7e46d (from 3b1daf5e88c1a88ac97db76cbd0a2ae0c45472dd)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 16:14:40 2007 +0100

    rework toString
    
    it seems that there's only one function that does all the toString magic

diff --git a/libswfdec/js/jsobj.c b/libswfdec/js/jsobj.c
index 860e38c..81ac409 100644
--- a/libswfdec/js/jsobj.c
+++ b/libswfdec/js/jsobj.c
@@ -905,48 +905,42 @@ js_obj_toSource(JSContext *cx, JSObject 
 }
 #endif /* JS_HAS_INITIALIZERS || JS_HAS_TOSOURCE */
 
+extern const JSClass movieclip_class;
+extern char *swfdec_movie_get_path (void *movieclip);
+extern void g_free (void *p);
 JSBool
 js_obj_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
                 jsval *rval)
 {
-    jschar *chars;
-    size_t nchars;
-    const char *clazz, *prefix;
+    const char *name;
     JSString *str;
     JSClass *clasp;
 
-#if JS_HAS_INITIALIZERS
-    if (cx->version == JSVERSION_1_2)
-        return js_obj_toSource(cx, obj, argc, argv, rval);
-#endif
-
     clasp = OBJ_GET_CLASS(cx, obj);
-    clazz = clasp->name;
-    /* special case in here (woohoo) */
     if (clasp == &js_ArgumentsClass) {
-      *rval = STRING_TO_JSVAL(cx->runtime->emptyString);
-      return JS_TRUE;
+	*rval = STRING_TO_JSVAL(cx->runtime->emptyString);
+	return JS_TRUE;
     }
-
-    nchars = 9 + strlen(clazz);         /* 9 for "[object ]" */
-    chars = (jschar *) JS_malloc(cx, (nchars + 1) * sizeof(jschar));
-    if (!chars)
-        return JS_FALSE;
-
-    prefix = "[object ";
-    nchars = 0;
-    while ((chars[nchars] = (jschar)*prefix) != 0)
-        nchars++, prefix++;
-    while ((chars[nchars] = (jschar)*clazz) != 0)
-        nchars++, clazz++;
-    chars[nchars++] = ']';
-    chars[nchars] = 0;
-
-    str = js_NewString(cx, chars, nchars, 0);
-    if (!str) {
-        JS_free(cx, chars);
-        return JS_FALSE;
+    if (clasp == &movieclip_class) {
+	void *p = JS_GetPrivate (cx, obj);
+	if (p) {
+	    char *path = swfdec_movie_get_path (p);
+	    str = JS_NewStringCopyZ (cx, path);
+	    g_free (path);
+	    if (!str)
+		return JS_FALSE;
+	    *rval = STRING_TO_JSVAL(str);
+	    return JS_TRUE;
+	}
     }
+    if (clasp == &js_FunctionClass) {
+	name = "[type Function]";
+    } else {
+	name = "[object Object]";
+    }
+    str = JS_NewStringCopyZ (cx, name);
+    if (!str) 
+        return JS_FALSE;
     *rval = STRING_TO_JSVAL(str);
     return JS_TRUE;
 }
diff --git a/libswfdec/swfdec_js_color.c b/libswfdec/swfdec_js_color.c
index 095abd7..0984207 100644
--- a/libswfdec/swfdec_js_color.c
+++ b/libswfdec/swfdec_js_color.c
@@ -137,25 +137,11 @@ swfdec_js_color_set_transform (JSContext
   return JS_TRUE;
 }
 
-static JSBool
-swfdec_js_color_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
-  JSString *string;
-
-  string = JS_InternString (cx, "[object Object]");
-  if (string == NULL)
-    return JS_FALSE;
-
-  *rval = STRING_TO_JSVAL (string);
-  return JS_TRUE;
-}
-
 static JSFunctionSpec color_methods[] = {
   { "getRGB",		swfdec_js_color_get_rgb,	1, 0, 0 },
   { "getTransform",  	swfdec_js_color_get_transform,	1, 0, 0 },
   { "setRGB",		swfdec_js_color_set_rgb,	1, 0, 0 },
   { "setTransform",  	swfdec_js_color_set_transform,	1, 0, 0 },
-  { "toString",	  	swfdec_js_color_to_string,	0, 0, 0 },
   {0,0,0,0,0}
 };
 
diff --git a/libswfdec/swfdec_js_connection.c b/libswfdec/swfdec_js_connection.c
index 1568e64..6f3e929 100644
--- a/libswfdec/swfdec_js_connection.c
+++ b/libswfdec/swfdec_js_connection.c
@@ -50,22 +50,8 @@ swfdec_js_connection_connect (JSContext 
   return JS_TRUE;
 }
 
-static JSBool
-swfdec_js_connection_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
-  JSString *string;
-
-  string = JS_InternString (cx, "[object Object]");
-  if (string == NULL)
-    return JS_FALSE;
-
-  *rval = STRING_TO_JSVAL (string);
-  return JS_TRUE;
-}
-
 static JSFunctionSpec connection_methods[] = {
   { "connect",		swfdec_js_connection_connect,	1, 0, 0 },
-  { "toString",		swfdec_js_connection_to_string,	0, 0, 0 },
   {0,0,0,0,0}
 };
 
diff --git a/libswfdec/swfdec_js_movie.c b/libswfdec/swfdec_js_movie.c
index 1aa2b87..e0f3f54 100644
--- a/libswfdec/swfdec_js_movie.c
+++ b/libswfdec/swfdec_js_movie.c
@@ -598,27 +598,6 @@ swfdec_js_getURL (JSContext *cx, JSObjec
   return JS_TRUE;
 }
 
-static JSBool
-swfdec_js_movie_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
-  char *s;
-  JSString *string;
-  SwfdecMovie *movie;
-
-  movie = JS_GetPrivate (cx, obj);
-  if (movie) {
-    s = swfdec_movie_get_path (movie);
-    string = JS_NewStringCopyZ (cx, s);
-    g_free (s);
-  } else {
-    string = JS_NewStringCopyZ (cx, "[object Object]");
-  }
-  if (string == NULL)
-    return JS_FALSE;
-  *rval = STRING_TO_JSVAL (string);
-  return JS_TRUE;
-}
-
 static JSFunctionSpec movieclip_methods[] = {
   { "attachMovie",	swfdec_js_movie_attachMovie,	3, 0, 0 },
   { "duplicateMovieClip", swfdec_js_movie_duplicateMovieClip, 2, 0, 0 },
@@ -640,7 +619,6 @@ static JSFunctionSpec movieclip_methods[
   { "stop",		mc_stop,			0, 0, 0 },
   { "stopDrag",    	swfdec_js_stopDrag,		0, 0, 0 },
   { "swapDepths",    	swfdec_js_movie_swapDepths,   	1, 0, 0 },
-  { "toString",	  	swfdec_js_movie_to_string,	0, 0, 0 },
   { NULL }
 };
 
diff --git a/libswfdec/swfdec_js_net_stream.c b/libswfdec/swfdec_js_net_stream.c
index ed9c81e..f92634c 100644
--- a/libswfdec/swfdec_js_net_stream.c
+++ b/libswfdec/swfdec_js_net_stream.c
@@ -43,22 +43,8 @@ swfdec_js_net_stream_play (JSContext *cx
   return JS_TRUE;
 }
 
-static JSBool
-swfdec_js_net_stream_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
-  JSString *string;
-
-  string = JS_InternString (cx, "[object Object]");
-  if (string == NULL)
-    return JS_FALSE;
-
-  *rval = STRING_TO_JSVAL (string);
-  return JS_TRUE;
-}
-
 static JSFunctionSpec net_stream_methods[] = {
   { "play",		swfdec_js_net_stream_play,	1, 0, 0 },
-  { "toString",		swfdec_js_net_stream_to_string,	0, 0, 0 },
   {0,0,0,0,0}
 };
 
diff --git a/libswfdec/swfdec_js_video.c b/libswfdec/swfdec_js_video.c
index db2e64f..946ebf7 100644
--- a/libswfdec/swfdec_js_video.c
+++ b/libswfdec/swfdec_js_video.c
@@ -59,23 +59,9 @@ swfdec_js_video_clear (JSContext *cx, JS
   return JS_TRUE;
 }
 
-static JSBool
-swfdec_js_video_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
-  JSString *string;
-
-  string = JS_InternString (cx, "[object Object]");
-  if (string == NULL)
-    return JS_FALSE;
-
-  *rval = STRING_TO_JSVAL (string);
-  return JS_TRUE;
-}
-
 static JSFunctionSpec video_methods[] = {
   { "attachVideo",    	swfdec_js_video_attach_video,	1, 0, 0 },
   { "clear",    	swfdec_js_video_clear,		0, 0, 0 },
-  { "toString",		swfdec_js_video_to_string,	0, 0, 0 },
   {0,0,0,0,0}
 };
 
diff --git a/libswfdec/swfdec_js_xml.c b/libswfdec/swfdec_js_xml.c
index e2cdecf..59632b6 100644
--- a/libswfdec/swfdec_js_xml.c
+++ b/libswfdec/swfdec_js_xml.c
@@ -42,22 +42,8 @@ swfdec_js_xml_load (JSContext *cx, JSObj
   return JS_TRUE;
 }
 
-static JSBool
-swfdec_js_xml_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
-  JSString *string;
-
-  string = JS_InternString (cx, "[object Object]");
-  if (string == NULL)
-    return JS_FALSE;
-
-  *rval = STRING_TO_JSVAL (string);
-  return JS_TRUE;
-}
-
 static JSFunctionSpec xml_methods[] = {
   { "load",		swfdec_js_xml_load,		1, 0, 0 },
-  { "toString",		swfdec_js_xml_to_string,	0, 0, 0 },
   {0,0,0,0,0}
 };
 
diff-tree 3b1daf5e88c1a88ac97db76cbd0a2ae0c45472dd (from 555b7e2aeae67c6901d2a0b9de298ca0479eeecb)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 16:14:03 2007 +0100

    add *.swf and *.flv files to .gitignore
    
    This is my favorite directory to dump random files to test with into,
    and I don't want them to clutter git

diff --git a/player/.gitignore b/player/.gitignore
index f2dfbf1..c5a38e3 100644
--- a/player/.gitignore
+++ b/player/.gitignore
@@ -14,3 +14,6 @@ swfdec_playback.c
 libswfdecui.la
 swfdebug
 swfplay
+
+*.swf
+*.flv
diff-tree 555b7e2aeae67c6901d2a0b9de298ca0479eeecb (from 41a55370d4636e6bb3d39e0e6a3f1af1438df5db)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 16:05:49 2007 +0100

    set the function as property on the scope chain, not on this

diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 50dbf2b..8c24c5d 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -1684,7 +1684,7 @@ swfdec_action_define_function (JSContext
     *cx->fp->sp++ = OBJECT_TO_JSVAL (fun->object);
   } else {
     jsval val = OBJECT_TO_JSVAL (fun->object);
-    if (!JS_SetProperty (cx, cx->fp->thisp, function_name, &val))
+    if (!JS_SetProperty (cx, cx->fp->scopeChain, function_name, &val))
       return JS_FALSE;
   }
 
diff-tree 41a55370d4636e6bb3d39e0e6a3f1af1438df5db (from b86811135dd32ae460e5082f4f986664de624b89)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Mar 11 13:38:26 2007 +0100

    add libswfedit.la files

diff --git a/test/.gitignore b/test/.gitignore
index eb7f89f..c443fa9 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -6,8 +6,11 @@ CVS
 
 Makefile
 Makefile.in
+*.lo
 *.o
 
+libswfedit.la
+
 dump
 parse
 swfdec-extract


More information about the Swfdec mailing list