Displaying 20 results from an estimated 42 matches for "swfdec_as_stack_pop".
2007 May 29
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_tag.c player/swfplay.c
...gt;sp -= 2;
- name = swfdec_js_to_string (cx, cx->fp->sp[1]);
- if (name == NULL)
- return JS_FALSE;
- if (!JSVAL_IS_OBJECT (cx->fp->sp[0]))
- return JS_TRUE;
- return JS_DeleteProperty (cx, JSVAL_TO_OBJECT (cx->fp->sp[0]), name);
+ name = swfdec_as_value_to_string (cx, swfdec_as_stack_pop (cx->frame->stack));
+ val = swfdec_as_stack_pop (cx->frame->stack);
+ if (SWFDEC_AS_VALUE_IS_OBJECT (val))
+ swfdec_as_object_delete_variable (SWFDEC_AS_VALUE_GET_OBJECT (val), name);
}
static void
swfdec_action_delete2 (SwfdecAsContext *cx, guint action, const guint8 *data,...
2007 Jun 17
2
Branch 'as' - libswfdec/swfdec_as_interpret.c
...t the values to a string when comparing strings
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 99ceb2b..9c98b45 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -780,7 +780,8 @@ swfdec_action_new_comparison_7 (SwfdecAs
swfdec_as_stack_pop (cx->frame->stack);
SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx->frame->stack, 1));
} else if (SWFDEC_AS_VALUE_IS_STRING (rval) || SWFDEC_AS_VALUE_IS_STRING (lval)) {
- int comp = strcmp (SWFDEC_AS_VALUE_GET_STRING (rval), SWFDEC_AS_VALUE_GET_STRING (lval));
+...
2007 Oct 25
0
6 commits - libswfdec/swfdec_as_interpret.c test/trace
...eOf
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index b18ddbf..5224538 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -2239,19 +2239,18 @@ swfdec_action_cast (SwfdecAsContext *cx, guint action, const guint8 *data,
val = swfdec_as_stack_pop (cx);
if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
- constructor = SWFDEC_AS_VALUE_GET_OBJECT (val);
+ object = SWFDEC_AS_VALUE_GET_OBJECT (val);
} else {
- constructor = NULL;
+ object = NULL;
}
-
+
val = swfdec_as_stack_pop (cx);
if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
- o...
2007 Jun 20
1
Branch 'as' - 2 commits - libswfdec/swfdec_as_interpret.c
...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_as_value_to_number (cx, swfdec_as_stack_peek (cx->frame->stack, 1));
/* yay...
2007 Oct 26
0
3 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_interpret.c
...fdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -2538,25 +2538,151 @@ static void
swfdec_action_throw (SwfdecAsContext *cx, guint action, const guint8 *data,
guint len)
{
- SwfdecAsValue *val;
- SwfdecAsObject *object;
+ cx->throwing = TRUE;
+ cx->throw_value = *swfdec_as_stack_pop (cx);
+}
- val = swfdec_as_stack_pop (cx);
- if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
- object = SWFDEC_AS_VALUE_GET_OBJECT (val);
- } else {
- object = NULL;
+typedef struct {
+ const guint8 * start;
+ gboolean catch;
+ gboolean finally;
+ guint catch_size;
+ guint finally_size...
2007 Jul 12
0
Branch 'as' - 7 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_with.c libswfdec/swfdec_sprite_movie.c test/trace
...dec_as_interpret.c
@@ -2039,19 +2039,21 @@ static void
swfdec_action_with (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
SwfdecAsObject *object;
+ guint offset;
if (len != 2) {
SWFDEC_ERROR ("With action requires a length of 2, but got %u", len);
swfdec_as_stack_pop (cx);
return;
}
+ offset = data[0] | (data[1] << 8);
object = swfdec_as_value_to_object (cx, swfdec_as_stack_peek (cx, 1));
if (object == NULL) {
- SWFDEC_ERROR ("With called without an object");
- swfdec_as_stack_pop (cx);
- return;
+ SWFDEC_INFO ("W...
2007 Oct 14
0
4 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_sound.c test/trace
...movie;
return TRUE;
@@ -694,58 +705,59 @@ extern struct {
static void
swfdec_action_get_property (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- SwfdecAsValue *val;
- SwfdecAsObject *obj;
+ SwfdecMovie *movie;
guint id;
- id = swfdec_as_value_to_integer (cx, swfdec_as_stack_pop (cx));
- if (id > (cx->version > 4 ? 21 : 18)) {
- SWFDEC_WARNING ("trying to SetProperty %u, not allowed", id);
- goto out;
- }
- val = swfdec_as_stack_peek (cx, 1);
- swfdec_as_interpret_eval (cx, NULL, val);
- if (SWFDEC_AS_VALUE_IS_UNDEFINED (val)) {
- obj = cx-...
2007 Apr 05
0
Branch 'as' - 9 commits - configure.ac libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -532,10 +532,116 @@ swfdec_action_set_variable (SwfdecAsCont
const char *s;
s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx->frame->stack, 2));
- swfdec_as_context_eval_set (cx, NULL, s, swfdec_as_stack_pop (cx->frame->stack));
+ swfdec_as_context_eval_set (cx, NULL, s, swfdec_as_stack_peek (cx->frame->stack, 1));
+ swfdec_as_stack_pop_n (cx->frame->stack, 2);
+}
+
+static const char *
+swfdec_as_interpret_eval (SwfdecAsContext *cx, SwfdecAsObject *obj,
+ SwfdecAsValue *val)
+{...
2007 Oct 26
0
2 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h test/trace
...guint action, const guint8 *data,
}
static void
+swfdec_action_implements (SwfdecAsContext *cx, guint action,
+ const guint8 *data, guint len)
+{
+ SwfdecAsValue *val, *argv;
+ SwfdecAsObject *object, *proto, *interface;
+ int argc, i;
+
+ swfdec_as_stack_ensure_size (cx, 2);
+
+ val = swfdec_as_stack_pop (cx);
+ if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
+ object = SWFDEC_AS_VALUE_GET_OBJECT (val);
+ swfdec_as_object_get_variable (object, SWFDEC_AS_STR_prototype, val);
+ if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
+ proto = SWFDEC_AS_VALUE_GET_OBJECT (val);
+ } else {
+ proto = NULL;...
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
...->fp->sp[-2]);
- if (s == NULL)
- return JS_FALSE;
-
- swfdec_js_eval_set (cx, NULL, s, cx->fp->sp[-1]);
- cx->fp->sp -= 2;
- return JS_TRUE;
+ s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx->frame->stack, 2));
+ swfdec_as_context_eval_set (cx, NULL, s, swfdec_as_stack_pop (cx->frame->stack));
+ swfdec_as_stack_pop (cx->frame->stack);
}
+#if 0
static void
swfdec_action_trace (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
@@ -2356,8 +2349,10 @@ const SwfdecActionSpec swfdec_as_actions
[0x15] = { "StringExtract", NU...
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
...interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -544,9 +544,14 @@ swfdec_action_set_member (SwfdecAsContex
static void
swfdec_action_trace (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
+ SwfdecAsValue *val;
const char *s;
- s = swfdec_as_value_to_printable (cx, swfdec_as_stack_pop (cx->frame->stack));
+ val = swfdec_as_stack_pop (cx->frame->stack);
+ if (val->type == SWFDEC_AS_TYPE_UNDEFINED)
+ s = SWFDEC_AS_STR_undefined;
+ else
+ s = swfdec_as_value_to_string (cx, val);
swfdec_as_context_trace (cx, s);
}
diff --git a/libswfdec/swfdec_as_types....
2007 Apr 12
0
Branch 'as' - 15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...S_OBJECT (swfdec_as_stack_peek (frame->stack, 1)) ||
!SWFDEC_AS_VALUE_IS_OBJECT (swfdec_as_stack_peek (frame->stack, 2)))
@@ -667,7 +669,20 @@ swfdec_action_call (SwfdecAsContext *cx,
goto error;
thisp = SWFDEC_AS_VALUE_GET_OBJECT (swfdec_as_stack_peek (frame->stack, 2));
swfdec_as_stack_pop_n (frame->stack, 2);
- swfdec_as_function_call (fun, thisp, n_args);
+ /* swap arguments on the stack */
+ /* FIXME: can we somehow keep this order please, it might be interesting for debuggers */
+ for (i = 0; i < n_args / 2; i++) {
+ SwfdecAsValue tmp = *swfdec_as_stack_peek (frame-&...
2007 Jul 11
0
Branch 'as' - libswfdec/swfdec_as_object.c
...text, script);
+ context = object->context;
+ frame = swfdec_as_frame_new (context, script);
if (frame == NULL)
return;
swfdec_as_frame_set_this (frame, object);
swfdec_as_frame_preload (frame);
- swfdec_as_context_run (object->context);
+ swfdec_as_context_run (context);
+ swfdec_as_stack_pop (context);
}
/**
2007 Oct 26
0
8 commits - doc/swfdec-sections.txt libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_interpret.c test/trace
...interpret.c
index f4ecef7..9155290 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -2538,8 +2538,7 @@ static void
swfdec_action_throw (SwfdecAsContext *cx, guint action, const guint8 *data,
guint len)
{
- cx->throwing = TRUE;
- cx->throw_value = *swfdec_as_stack_pop (cx);
+ swfdec_as_context_throw (cx, swfdec_as_stack_pop (cx));
}
typedef struct {
@@ -2584,19 +2583,17 @@ swfdec_action_try_data_unref (gpointer data)
static void
swfdec_action_try_end_finally (SwfdecAsFrame *frame, gpointer data)
{
- SwfdecAsValue *error = data;
+ SwfdecAsValue *excepti...
2007 Oct 28
1
2 commits - libswfdec/swfdec_as_interpret.c test/trace
...c
index 7125e05..c331413 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -948,6 +948,7 @@ swfdec_action_binary (SwfdecAsContext *cx, guint action, const guint8 *data, gui
case SWFDEC_AS_ACTION_DIVIDE:
if (cx->version < 5) {
if (r == 0) {
+ swfdec_as_stack_pop (cx);
SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_peek (cx, 1), SWFDEC_AS_STR__ERROR_);
return;
}
commit 45f142e1ddb65fc1c2acf1a37e7ff9f46fba8452
Author: Benjamin Otte <otte at gnome.org>
Date: Sun Oct 28 19:48:29 2007 +0100
Divide by zero crashes in Flash 4
diff --git a/tes...
2007 Jun 28
0
Branch 'as' - 5 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c test/trace
...s_interpret.c
@@ -1998,6 +1998,35 @@ swfdec_action_with (SwfdecAsContext *cx,
swfdec_as_with_new (object, data + len, GUINT16_FROM_LE (*(guint16 *) data));
}
+static void
+swfdec_action_remove_sprite (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
+{
+ SwfdecAsValue *val = swfdec_as_stack_pop (cx->frame->stack);
+ SwfdecAsObject *sprite;
+ SwfdecMovie *movie;
+
+ if (SWFDEC_AS_VALUE_IS_STRING (val)) {
+ const char *name = SWFDEC_AS_VALUE_GET_STRING (val);
+
+ swfdec_as_context_eval (cx, NULL, name, val);
+ }
+ if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
+ sprite = SWFDEC_...
2007 Apr 11
0
Branch 'as' - 4 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...ion_logical (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- void l, r;
+ SwfdecAsValue *val;
+ gboolean l, r;
- l = swfdec_value_to_boolean_7 (cx, cx->fp->sp[-1]);
- r = swfdec_value_to_boolean_7 (cx, cx->fp->sp[-2]);
+ l = swfdec_as_value_to_boolean (cx, swfdec_as_stack_pop (cx->frame->stack));
+ val = swfdec_as_stack_peek (cx->frame->stack, 1);
+ r = swfdec_as_value_to_boolean (cx, val);
- cx->fp->sp--;
- if (action == 0x10)
- cx->fp->sp[-1] = l && r ? JSVAL_TRUE : JSVAL_FALSE;
- else
- cx->fp->sp[-1] = l || r ? JSVA...
2007 Jul 04
0
Branch 'as' - 25 commits - libswfdec/Makefile.am libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...e at least 2 elements big */
static gboolean
-swfdec_action_call (SwfdecAsContext *cx, guint n_args)
+swfdec_action_call (SwfdecAsContext *cx, guint n_args, gboolean use_super)
{
SwfdecAsFunction *fun;
SwfdecAsObject *thisp;
@@ -591,6 +592,13 @@ swfdec_action_call (SwfdecAsContext *cx,
swfdec_as_stack_pop_n (frame->stack, n_args);
swfdec_as_function_call (fun, thisp, n_args, swfdec_as_stack_peek (frame->stack, 0),
swfdec_as_stack_peek (frame->stack, 1));
+ if (use_super) {
+ g_print ("replacing super object\n");
+ if (cx->frame->super && SWFDEC_AS_S...
2007 Mar 29
0
Branch 'as' - 9 commits - configure.ac doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_stack.c
...bswfdec/swfdec_as_stack.h b/libswfdec/swfdec_as_stack.h
index 4792b33..c201e8a 100644
--- a/libswfdec/swfdec_as_stack.h
+++ b/libswfdec/swfdec_as_stack.h
@@ -40,7 +40,7 @@ void swfdec_as_stack_free (SwfdecAsSta
#define swfdec_as_stack_peek(stack,n) (&(stack)->cur[-(gssize)(n)])
#define swfdec_as_stack_pop(stack) (--(stack)->cur)
-#define swfdec_as_stack_push(stack,val) (*(stack)->cur++)
+#define swfdec_as_stack_push(stack,val) (*(stack)->cur++ = *(val))
void swfdec_as_stack_mark (SwfdecAsStack * stack);
void swfdec_as_stack_ensure_size (SwfdecAsStack * stack,
diff-tree b65aacea6f0606...
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
...+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) ||
- !SWFDEC_IS_AS_FUNCTION (fun = (SwfdecAs...