search for: swfdec_action_define_function

Displaying 20 results from an estimated 38 matches for "swfdec_action_define_function".

2007 Feb 16
0
11 commits - libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h test/.gitignore test/trace
...allocate 4 local variables in swfdec_script_interpret diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index dc8b2a5..95a5561 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1418,7 +1418,8 @@ swfdec_action_init_object (JSContext *cx } static JSBool -swfdec_action_define_function (JSContext *cx, guint action, const guint8 *data, guint len) +swfdec_action_do_define_function (JSContext *cx, guint action, + const guint8 *data, guint len, gboolean v2) { const char *function_name; guint i, n_args, size; @@ -1426,7 +1427,8 @@ swfdec_action_define_function (JSContext...
2007 Oct 10
0
2 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_script_function.h
...16:38:37 2007 +0200 don't set the target of functions defined in the init scripts diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 907e01e..868f6f9 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1850,6 +1850,11 @@ swfdec_action_define_function (SwfdecAsC } if (fun == NULL) return; + /* This is a hack that should only trigger for functions defined in the init scripts. + * It is supposed to ensure that those functions inherit their target when being + * called instead of when being defined */ + if (!SWFDEC_IS_MOVIE (frame...
2007 Mar 16
0
4 commits - libswfdec/swfdec_script.c test/image test/trace
...uthor: Benjamin Otte <otte@gnome.org> Date: Fri Mar 16 17:58:30 2007 +0100 fix scope chains in Flash 5 diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index 7b520eb..5c6a0c2 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1647,6 +1647,7 @@ swfdec_action_define_function (JSContext SwfdecBits bits; JSFunction *fun; SwfdecScript *script; + JSObject *scope; gboolean has_preloads = FALSE; guint flags = 0; guint8 *preloads = NULL; @@ -1659,14 +1660,23 @@ swfdec_action_define_function (JSContext return JS_FALSE; } n_args = swfdec_bits_get_u...
2007 Oct 26
0
3 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_interpret.c
...7 +0300 Add stubs for Try and Throw actions (just read the parameters, but do nothing) diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 1605a1a..af79c7b 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1785,8 +1785,8 @@ swfdec_action_define_function (SwfdecAsContext *cx, guint action, char *function_name; const char *name = NULL; guint i, n_args, size, n_registers; - SwfdecBuffer *buffer; SwfdecBits bits; + SwfdecBuffer *buffer; SwfdecAsFunction *fun; SwfdecAsFrame *frame; SwfdecScript *script; @@ -2535,6 +2535,61 @@ swf...
2007 Nov 07
0
14 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field_movie.c
...CTION_GOTO_LABEL] = { "GotoLabel", swfdec_action_print_goto_label, 0, 0, swfdec_action_goto_label, 3 }, @@ -3224,7 +3224,7 @@ const SwfdecActionSpec swfdec_as_actions[256] = { [SWFDEC_AS_ACTION_DEFINE_FUNCTION] = { "DefineFunction", swfdec_action_print_define_function, 0, -1, swfdec_action_define_function, 5 }, /* version 4 */ [SWFDEC_AS_ACTION_IF] = { "If", swfdec_action_print_if, 1, 0, swfdec_action_if, 4 }, - [SWFDEC_AS_ACTION_CALL] = { "Call", NULL }, + [SWFDEC_AS_ACTION_CALL] = { "Call", NULL, -1, -1, NULL, 4 }, [SWFDEC_AS_ACTION_GOTO_FRAME2] = { "G...
2007 Feb 17
0
8 commits - configure.ac doc/swfdec-sections.txt libswfdec/swfdec_loader.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h
..., + [0x9a] = { "GetURL2", swfdec_action_print_get_url2, 2, 0, { NULL, swfdec_action_get_url2, swfdec_action_get_url2, swfdec_action_get_url2, swfdec_action_get_url2 } }, /* version 5 */ [0x9b] = { "DefineFunction", swfdec_action_print_define_function, 0, -1, { NULL, NULL, swfdec_action_define_function, swfdec_action_define_function, swfdec_action_define_function } }, /* version 4 */ diff-tree 826758e8e3b45a7dd7f55d5e7891659da30d4daf (from d33393b8767f81772dee644af8bc7143e766e4bb) Author: Benjamin Otte <otte@gnome.org> Date: Sat Feb 17 11:18:54 2007 +0100 Add swfdec_player_set_loa...
2007 Aug 20
0
15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_with.c
...gt; Date: Mon Aug 20 13:06:39 2007 +0200 fix valgrind reported memleaks diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 9e69d46..23e4116 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1465,7 +1465,7 @@ static void swfdec_action_define_function (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) { - const char *function_name; + char *function_name; const char *name = NULL; guint i, n_args, size, n_registers; SwfdecBuffer *buffer; @@ -1533,6 +1533,7 @@ swfdec_action_define_function (SwfdecAsC if (frame-&g...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_interpret.c
...at gnome.org> Date: Fri Aug 17 17:31:44 2007 +0200 0 registers means 4 registers diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index ecc828a..47e62d5 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1499,6 +1499,8 @@ swfdec_action_define_function (SwfdecAsC n_args = swfdec_bits_get_u16 (&bits); if (v2) { n_registers = swfdec_bits_get_u8 (&bits); + if (n_registers == 0) + n_registers = 4; flags = swfdec_bits_get_u16 (&bits); } else { n_registers = 5;
2007 Jun 20
1
Branch 'as' - 2 commits - libswfdec/swfdec_as_interpret.c
libswfdec/swfdec_as_interpret.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) New commits: diff-tree 9c5cb7cb9f6278896bc8a1e7cd7fb541b079c8de (from 1e19719b58b5cfcb800c81a5f5432c3ad662dbbc) Author: Benjamin Otte <otte at gnome.org> Date: Wed Jun 20 20:58:52 2007 +0200 the modulo arguments were mixed diff --git a/libswfdec/swfdec_as_interpret.c
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
..., obj, s, &fun)) + return JS_FALSE; + fp->sp[-1] = fun; + fp->sp[-2] = OBJECT_TO_JSVAL (obj); + swfdec_action_call (cx, n_args, 0); + return JS_TRUE; +} + static JSBool swfdec_action_call_method (JSContext *cx, guint action, const guint8 *data, guint len) { @@ -1207,7 +1234,9 @@ swfdec_action_define_function (JSContext } *cx->fp->sp++ = OBJECT_TO_JSVAL (fun->object); } else { - SWFDEC_ERROR ("FIXME: implement"); + jsval val = OBJECT_TO_JSVAL (fun->object); + if (!JS_SetProperty (cx, OBJ_THIS_OBJECT (cx, cx->fp->scopeChain), function_name, &val)) +...
2007 Mar 09
0
17 commits - libswfdec/js libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...1)) return JS_FALSE; - } /* items are the wrong order on the stack */ j = - 1 - n_items; @@ -1540,8 +1572,8 @@ swfdec_action_init_array (JSContext *cx, } static JSBool -swfdec_action_do_define_function (JSContext *cx, guint action, - const guint8 *data, guint len, gboolean v2) +swfdec_action_define_function (JSContext *cx, guint action, + const guint8 *data, guint len) { const char *function_name; guint i, n_args, size; @@ -1551,6 +1583,7 @@ swfdec_action_do_define_function (JSCont gboolean has_preloads = FALSE; guint flags = 0; guint8 *preloads = NULL; + gboolean v2 = (action == 0...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
...rsion (&bits, cx->version); + url = swfdec_bits_get_string (&bits, cx->version); + target = swfdec_bits_get_string (&bits, cx->version); if (url == NULL || target == NULL) { SWFDEC_ERROR ("not enough data in GetURL"); g_free (url); @@ -1797,7 +1797,7 @@ swfdec_action_define_function (SwfdecAsContext *cx, guint action, frame = cx->frame; swfdec_bits_init_data (&bits, data, len); - function_name = swfdec_bits_get_string_with_version (&bits, cx->version); + function_name = swfdec_bits_get_string (&bits, cx->version); if (function_name == NULL) {...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...= fp->sp[i]; + fp->sp[i] = fp->sp[j]; + fp->sp[j] = tmp; + } + array = JS_NewArrayObject (cx, n_items, fp->sp - n_items - 1); + if (array == NULL) + return JS_FALSE; + fp->sp -= n_items; + fp->sp[-1] = OBJECT_TO_JSVAL (array); + return JS_TRUE; +} + +static void +swfdec_action_define_function (SwfdecAsContext *cx, guint action, + const guint8 *data, guint len) +{ + const char *function_name; + guint i, n_args, size; + SwfdecBits bits; + JSFunction *fun; + SwfdecScript *script; + JSObject *scope; + gboolean has_preloads = FALSE; + guint flags = 0; + guint8 *preloads = NULL; +...
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
..._to_player (SwfdecScript *script, SwfdecPlayer *player) +{ + if (SWFDEC_IS_DEBUGGER (player)) { + swfdec_debugger_add_script (SWFDEC_DEBUGGER (player), script); + script->debugger = player; + } +} + /** * swfdec_script_ensure_stack: * @cx: #JSContext to check @@ -1733,22 +1740,22 @@ swfdec_action_define_function (JSContext } if (name == NULL) name = "unnamed_function"; - script = swfdec_script_new_for_player (JS_GetContextPrivate (cx), - &bits, name, ((SwfdecScript *) cx->fp->swf)->version); + script = swfdec_script_new (&bits, name, ((SwfdecScript *) cx-&g...
2007 Jan 31
0
Branch 'interpreter' - 3 commits - libswfdec/js libswfdec/swfdec_script.c
...Date: Wed Jan 31 21:35:50 2007 +0100 implement BitAnd, BitOr, BitXor, DefineLocal, DefineLocal2 and Return diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index 9b3a328..46ba618 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1359,6 +1359,35 @@ swfdec_action_define_function (JSContext } static JSBool +swfdec_action_bitwise (JSContext *cx, guint action, const guint8 *data, guint len) +{ + guint32 a, b; + double d; + + if (!JS_ValueToECMAUint32 (cx, cx->fp->sp[-1], &a) || + !JS_ValueToECMAUint32 (cx, cx->fp->sp[-2], &b)) + return JS_FA...
2007 May 18
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_native_function.h
...t.c @@ -25,6 +25,7 @@ #include "swfdec_as_context.h" #include "swfdec_as_frame.h" #include "swfdec_as_function.h" +#include "swfdec_as_script_function.h" #include "swfdec_as_stack.h" #include "swfdec_debug.h" @@ -1266,12 +1267,12 @@ swfdec_action_define_function (SwfdecAsC } /* see function-scope tests */ if (cx->version > 5) { - fun = swfdec_as_function_new (frame->scope ? frame->scope : SWFDEC_AS_SCOPE (frame)); + fun = swfdec_as_script_function_new (frame->scope ? frame->scope : SWFDEC_AS_SCOPE (frame)); } else {...
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
...script to swfdec_as_script_function_new() also refactor code to make use of this diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 7b5d231..461c875 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1484,18 +1484,6 @@ swfdec_action_define_function (SwfdecAsC SWFDEC_ERROR ("could not parse function name"); return; } - /* see function-scope tests */ - if (cx->version > 5) { - /* FIXME: or original target? */ - fun = swfdec_as_script_function_new (frame->scope ? frame->scope : SWFDEC_AS_SCOPE (frame),...
2007 Apr 03
0
11 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_playback_alsa.c libswfdec-gtk/swfdec_source.c libswfdec/swfdec_cached.c libswfdec/swfdec_font.c libswfdec/swfdec_morphshape.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c
...Wilson <chris@chris-wilson.co.uk> Date: Tue Apr 3 09:38:33 2007 +0200 Fix minor leak of function_name. diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index 0aff14c..21c1fff 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1680,7 +1680,7 @@ swfdec_action_define_function (JSContext gboolean v2 = (action == 0x8e); swfdec_bits_init_data (&bits, data, len); - function_name = swfdec_bits_get_string (&bits); + function_name = swfdec_bits_skip_string (&bits); if (function_name == NULL) { SWFDEC_ERROR ("could not parse function name&quot...
2007 Feb 13
0
9 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c test/Makefile.am test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c
...ot;GetURL2", NULL }, + [0x9a] = { "GetURL2", NULL, 2, 0, { NULL, swfdec_action_get_url2, swfdec_action_get_url2, swfdec_action_get_url2, swfdec_action_get_url2 } }, /* version 5 */ [0x9b] = { "DefineFunction", swfdec_action_print_define_function, 0, -1, { NULL, NULL, swfdec_action_define_function, swfdec_action_define_function, swfdec_action_define_function } }, /* version 4 */ diff-tree e09255e66fe4990bd8531519ae20da81a4beb4f4 (from fa496c4d6ae5187e39c1b77cf7b13517be873a3c) Author: Benjamin Otte <otte@gnome.org> Date: Fri Feb 9 14:03:11 2007 +0100 use swfdec_bits_decompress...
2007 Jun 05
0
Branch 'as' - 8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_scope.h
...fdec_action_print_store_register (guint action, const guint8 *data, guint len) { if (len != 1) { @@ -2344,7 +2371,7 @@ const SwfdecActionSpec swfdec_as_actions [SWFDEC_AS_ACTION_DEFINE_FUNCTION2] = { "DefineFunction2", swfdec_action_print_define_function, 0, -1, { NULL, NULL, NULL, swfdec_action_define_function, swfdec_action_define_function } }, [SWFDEC_AS_ACTION_TRY] = { "Try", NULL }, /* version 5 */ - [SWFDEC_AS_ACTION_WITH] = { "With", NULL }, + [SWFDEC_AS_ACTION_WITH] = { "With", swfdec_action_print_with, 1, 0, { NULL, NULL, swfdec_action_with, swfdec_action_wit...