search for: swfdecascontex

Displaying 20 results from an estimated 26 matches for "swfdecascontex".

Did you mean: swfdecascontext
2007 Sep 02
0
libswfdec/swfdec_as_array.c libswfdec/swfdec_as_string.c
...Fix various String functions and Array sort crashing when called on other object diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c index 273b083..ff446d8 100644 --- a/libswfdec/swfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -943,6 +943,11 @@ swfdec_as_array_sort (SwfdecAsContext *c ForeachSortData fdata; guint pos; + if (!SWFDEC_IS_AS_ARRAY (object)) { + SWFDEC_FIXME ("Array.sort should work on non-array objects too"); + return; + } + fdata.length = swfdec_as_array_get_length (object); fdata.order_size = MIN ((gint32)g_hash_table_size...
2007 Sep 14
0
4 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_object.c test/trace
...It used to free argv before calling swfdec_as_context_run() diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c index 6cc40a4..3af3b46 100644 --- a/libswfdec/swfdec_as_function.c +++ b/libswfdec/swfdec_as_function.c @@ -172,6 +172,8 @@ void swfdec_as_function_apply (SwfdecAsContext *cx, SwfdecAsObject *fun, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { + SwfdecAsValue *argv_pass = NULL; + int length = 0; SwfdecAsObject *thisp; if (argc > 0) { @@ -182,11 +184,10 @@ swfdec_as_function_apply (SwfdecAsContex if (thisp == NULL) thisp = swfdec_a...
2007 Aug 24
0
7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_string.c test/trace
...uot; #include "swfdec_as_script_function.h" #include "swfdec_as_stack.h" +#include "swfdec_as_string.h" #include "swfdec_as_strings.h" #include "swfdec_as_super.h" #include "swfdec_as_with.h" @@ -552,10 +553,14 @@ swfdec_action_trace (SwfdecAsContext *cx const char *s; val = swfdec_as_stack_peek (cx, 1); - if (val->type == SWFDEC_AS_TYPE_UNDEFINED) + if (val->type == SWFDEC_AS_TYPE_UNDEFINED) { s = SWFDEC_AS_STR_undefined; - else + } else if (val->type == SWFDEC_AS_TYPE_OBJECT && + SWFDEC_IS_AS_STRING (sw...
2007 Jun 27
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie_as.c
...ite_movie.c b/libswfdec/swfdec_sprite_movie.c index d42aac3..457644e 100644 --- a/libswfdec/swfdec_sprite_movie.c +++ b/libswfdec/swfdec_sprite_movie.c @@ -555,24 +555,27 @@ static void swfdec_sprite_movie_init_movie (SwfdecMovie *mov) { SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (mov); - SwfdecAsContext *context; - SwfdecAsObject *constructor; - const char *name; + SwfdecAsContext *context = SWFDEC_AS_OBJECT (movie)->context; + SwfdecAsObject *constructor = NULL; - g_assert (movie->sprite->parse_frame > 0); g_assert (mov->swf != NULL); - movie->n_frames = movie->...
2007 Jun 20
1
Branch 'as' - 2 commits - libswfdec/swfdec_as_interpret.c
...Wed Jun 20 20:58:52 2007 +0200 the modulo arguments were mixed diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 596b632..48b75c9 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1732,8 +1732,8 @@ swfdec_action_modulo (SwfdecAsContext *c { double x, y; - x = swfdec_as_value_to_number (cx, swfdec_as_stack_pop (cx->frame->stack)); - y = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx->frame->stack, 1)); + y = swfdec_as_value_to_number (cx, swfdec_as_stack_pop (cx->frame->stack)); + x = swfdec_a...
2007 Jun 27
0
Branch 'as' - 16 commits - configure.ac libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_script_function.c
...My hacks come back and bite me, I need to seriously change that. diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 4f84189..b4bcc4f 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -448,6 +448,7 @@ swfdec_as_interpret_eval (SwfdecAsContex /* FIXME: this sucks */ extern struct { + gboolean needs_movie; const char * name; /* GC'd */ void (* get) (SwfdecMovie *movie, SwfdecAsValue *ret); void (* set) (SwfdecMovie *movie, const SwfdecAsValue *val); diff-tree cdb3324b8d8fd60ea0420de74b89a9edb1528b11 (from parents) Merge...
2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...51:17 2007 +0200 implement ActionGetVariable and ActionSetVariable diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 60c4046..aab5f44 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -512,22 +512,18 @@ swfdec_action_push (SwfdecAsContext *cx, } } -#if 0 static void swfdec_action_get_variable (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) { const char *s; - s = swfdec_js_to_string (cx, cx->fp->sp[-1]); - if (s == NULL) - return JS_FALSE; - cx->fp->sp[-1] = swfdec_js_eval (cx, NULL...
2007 Sep 10
0
3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...hash_table_foreach_steal (object->watches, swfdec_as_object_steal_watches, object); + object->watches = NULL; + } if (object->size) swfdec_as_context_unuse_mem (object->context, object->size); g_object_unref (object); @@ -1220,7 +1294,7 @@ void swfdec_as_object_watch (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval) { - SwfdecAsVariable *var; + SwfdecAsWatch *watch; const char *name; SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE); @@ -1230,34 +1304,30 @@ swfdec_as_object_watch (SwfdecAsContext name = swfdec...
2007 Apr 11
0
Branch 'as' - 4 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...ed Apr 11 21:09:52 2007 +0200 implement And and Or actions diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 249f9cc..3989186 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1831,41 +1831,24 @@ swfdec_action_enumerate2 (SwfdecAsContex JS_DestroyIdArray (cx, array); return JS_TRUE; } +#endif static void -swfdec_action_logical_5 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) -{ - void l, r; - - l = swfdec_value_to_boolean_5 (cx, cx->fp->sp[-1]); - r = swfdec_value_to_boolean_5 (cx, cx->fp-...
2007 Jun 28
0
Branch 'as' - 4 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...#GValue. The value held is garbage-collected. Apart from the type + * member, use the provided macros to access this structure. + * <note>If you memset a SwfdecAsValue to 0, it is a valid undefined value.</note> + */ + +/*** actual code ***/ + +/** + * swfdec_as_str_concat: + * @cx: a #SwfdecAsContext + * @s1: first string + * @s2: second string + * + * Convenience function to concatenate two garbage-collected strings. This + * function is equivalent to g_strconcat (). + * + * Returns: A new garbage-collected string + **/ const char * swfdec_as_str_concat (SwfdecAsContext *cx, const char * s1...
2007 Jun 27
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_js_video.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_video_movie_as.c libswfdec/swfdec_video_movie.c
...ate: Wed Jun 27 13:30:54 2007 +0200 fix NewMethod action diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index b4bcc4f..376f41f 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1365,16 +1365,13 @@ swfdec_action_new_method (SwfdecAsContex constructor = swfdec_as_stack_pop (cx->frame->stack); n_args = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx->frame->stack, 1)); n_args = MIN (swfdec_as_stack_get_size (cx->frame->stack) - 1, n_args); - if (!SWFDEC_AS_VALUE_IS_OBJECT (constructor) || - !S...
2007 Jul 13
0
12 commits - AUTHORS doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h
....h \ + swfdec_as_script_function.h \ swfdec_as_stack.h \ swfdec_as_string.h \ swfdec_as_strings.h \ diff --git a/doc/swfdec-docs.sgml b/doc/swfdec-docs.sgml index 2c7787f..553dfb1 100644 --- a/doc/swfdec-docs.sgml +++ b/doc/swfdec-docs.sgml @@ -27,5 +27,6 @@ <xi:include href="xml/SwfdecAsContext.xml"/> <xi:include href="xml/SwfdecAsObject.xml"/> <xi:include href="xml/SwfdecAsArray.xml"/> + <xi:include href="xml/SwfdecAsFunction.xml"/> </chapter> </book> diff --git a/doc/swfdec-sections.txt b/doc/swfdec-se...
2007 Aug 13
0
Branch 'vivi' - 24 commits - configure.ac libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h vivified/core vivified/dock vivified/ui
...200 make sure the player is inited when stepping diff --git a/vivified/core/vivi_application_as.c b/vivified/core/vivi_application_as.c index f5e68f9..24814a7 100644 --- a/vivified/core/vivi_application_as.c +++ b/vivified/core/vivi_application_as.c @@ -53,6 +53,7 @@ vivi_application_as_step (SwfdecAsContex ViviApplication *app = VIVI_APPLICATION (cx); int steps; + vivi_application_init_player (app); if (argc > 0) { steps = swfdec_as_value_to_integer (cx, &argv[0]); if (steps <= 1) diff-tree 304e2632c4cf90212677d717ad4adbb2e050de7e (from 9f18261bca69f8c630cb5ba3e2b98694...
2007 Sep 03
0
4 commits - libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_interpret.c test/trace
...G_DEFINE_TYPE (SwfdecAsBoolean, swfdec_as_boolean, SWFDEC_TYPE_AS_OBJECT) @@ -43,7 +44,8 @@ swfdec_as_boolean_init (SwfdecAsBoolean /*** AS CODE ***/ -static void +SWFDEC_AS_CONSTRUCTOR (107, 2, swfdec_as_boolean_construct, swfdec_as_boolean_get_type) +void swfdec_as_boolean_construct (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { @@ -63,48 +65,31 @@ swfdec_as_boolean_construct (SwfdecAsCon } } -static void +SWFDEC_AS_NATIVE (107, 1, swfdec_as_boolean_toString) +void swfdec_as_boolean_toString (SwfdecAsContext *cx, SwfdecAsObjec...
2007 Aug 22
0
8 commits - libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_sprite_movie_as.c vivified/core
...void vivi_application_stop (ViviApplication * app); diff --git a/vivified/core/vivi_application_as.c b/vivified/core/vivi_application_as.c index 6e2c011..2f9ec6e 100644 --- a/vivified/core/vivi_application_as.c +++ b/vivified/core/vivi_application_as.c @@ -41,7 +41,6 @@ vivi_application_as_run (SwfdecAsContext { ViviApplication *app = VIVI_APPLICATION (cx); - vivi_application_init_player (app); vivi_application_play (app); } @@ -63,7 +62,6 @@ vivi_application_as_step (SwfdecAsContex ViviApplication *app = VIVI_APPLICATION (cx); int steps; - vivi_application_init_player (app); if...
2007 Aug 17
0
Branch 'vivi' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_debugger.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c test/trace vivified/core vivified/ui
...version interpreter for a bytecode if the vurrent version doesn't know it diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index 96c23e4..b2a74cb 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -682,6 +682,7 @@ swfdec_as_context_run (SwfdecAsContext * SwfdecAsFrame *frame, *last_frame; SwfdecScript *script; const SwfdecActionSpec *spec; + SwfdecActionExec exec; guint8 *startpc, *pc, *endpc, *nextpc; #ifndef G_DISABLE_ASSERT SwfdecAsValue *check; @@ -813,12 +814,22 @@ start: nextpc = pc + 1; } /* check action...
2007 Jul 07
0
Branch 'as' - 7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h libswfdec/swfdec_as_with.c test/trace
...y. This seems to make all the testcases (soon to be committed) work. diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 2cabb64..7ade8ca 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -560,7 +560,7 @@ swfdec_action_trace (SwfdecAsContext *cx /* stack looks like this: [ function, this, arg1, arg2, ... ] */ /* stack must be at least 2 elements big */ static gboolean -swfdec_action_call (SwfdecAsContext *cx, guint n_args, gboolean use_super) +swfdec_action_call (SwfdecAsContext *cx, guint n_args) { SwfdecAsFunction *fun; Sw...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_array.c test/trace
...= G_OBJECT_CLASS (klass); SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass); - object_class->dispose = swfdec_as_array_dispose; - asobject_class->add = swfdec_as_array_add; asobject_class->set = swfdec_as_array_set; } @@ -374,7 +395,7 @@ swfdec_as_array_new (SwfdecAsContext *co g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL); g_return_val_if_fail (context->Array != NULL, NULL); - + if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsArray))) return FALSE; ret = g_object_new (SWFDEC_TYPE_AS_ARRAY, NULL); @@ -385,9 +406,10 @@ sw...
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
..._with.h \ swfdec_amf.h \ swfdec_audio_internal.h \ swfdec_audio_event.h \ diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index d899d1e..c10a5ea 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -402,6 +402,7 @@ swfdec_as_context_run (SwfdecAsContext * int version; SwfdecAsContextClass *klass; void (* step) (SwfdecAsContext *context); + gboolean check_scope; /* some opcodes avoid a scope check */ g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context)); if (context->frame == NULL) @@ -437,6 +438,7 @@ start: startpc = script-&g...
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
...and constructor object will be set correctly. - * - * Returns: a new object of @type or %NULL on OOM + * Sets the constructor and prototype of @fun. This is a shortcut for calling + * swfdec_as_object_set_constructor() with the right arguments. **/ -SwfdecAsFunction * -swfdec_as_function_create (SwfdecAsContext *context, GType type, guint size) +void +swfdec_as_function_set_constructor (SwfdecAsFunction *fun) { + SwfdecAsContext *context; + SwfdecAsObject *object; SwfdecAsValue val; - SwfdecAsObject *fun; - g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL); - g_return_val_if_fail (g_...