Displaying 20 results from an estimated 32 matches for "n_regist".
Did you mean:
regist
2007 Mar 28
0
Branch 'as' - 3 commits - 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_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...ec_as_context.h"
+#include "swfdec_debug.h"
+
+G_DEFINE_TYPE (SwfdecAsFrame, swfdec_as_frame, SWFDEC_TYPE_AS_OBJECT)
+
+static void
+swfdec_as_frame_dispose (GObject *object)
+{
+ SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object);
+
+ g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers);
+ swfdec_script_unref (frame->script);
+
+ G_OBJECT_CLASS (swfdec_as_frame_parent_class)->dispose (object);
+}
+
+static void
+swfdec_as_frame_mark (SwfdecAsObject *object)
+{
+ SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object);
+ guint i;
+
+ swfdec_as_object_mar...
2007 Jul 30
0
10 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_super.c libswfdec/swfdec_video_movie_as.c test/trace
...c_as_stack_iterator_init_arguments (&iter, frame);
+ for (i = 0; i < script->n_arguments; i++) {
+ if (cur == NULL)
+ cur = &val;
+ /* set this value at the right place */
+ if (script->arguments[i].preload) {
+ if (script->arguments[i].preload < frame->n_registers) {
+ frame->registers[script->arguments[i].preload] = *cur;
+ } else {
+ SWFDEC_ERROR ("trying to set %uth argument %s in nonexisting register %u",
+ i, script->arguments[i].name, script->arguments[i].preload);
+ }
+ } else {
+ const char *tmp = swfde...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_interpret.c
...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 May 21
0
Branch 'as' - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c
...wfdec_as_object_mark (frame->thisp);
+ if (frame->thisp)
+ swfdec_as_object_mark (frame->thisp);
if (frame->target)
swfdec_as_object_mark (frame->target);
if (frame->function)
@@ -76,7 +77,6 @@ swfdec_as_frame_mark (SwfdecAsObject *ob
for (i = 0; i < frame->n_registers; i++) {
swfdec_as_value_mark (&frame->registers[i]);
}
- /* FIXME: do we want this? */
for (i = 0; i < frame->argc; i++) {
swfdec_as_value_mark (&frame->argv[i]);
}
@@ -102,18 +102,15 @@ swfdec_as_frame_init (SwfdecAsFrame *fra
}
SwfdecAsFrame *
-swfde...
2007 Apr 17
0
Branch 'as' - 2 commits -
...or NULL */
SwfdecBuffer * buffer; /* buffer holding the script */
- unsigned int refcount; /* reference count */
+ guint refcount; /* reference count */
char * name; /* name identifying this script */
- unsigned int version; /* version of the script */
- unsigned int n_registers; /* number of registers */
- guint version; /* version of the script */
++ guint version; /* version of the script */
++ guint n_registers; /* number of registers */
gpointer debugger; /* debugger owning us or NULL */
/* needed by functions */
SwfdecBuffer * constant_p...
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
...uot;
#include "swfdec_as_frame.h"
+#include "swfdec_as_stack.h"
#include "swfdec_debug.h"
#include <errno.h>
@@ -44,7 +45,7 @@
/*** SUPPORT FUNCTIONS ***/
#define swfdec_action_has_register(cx, i) \
- ((i) < ((SwfdecScript *) (cx)->fp->swf)->n_registers)
+ ((i) < (cx)->frame->n_registers)
static SwfdecMovie *
swfdec_action_get_target (SwfdecAsContext *context)
@@ -60,16 +61,6 @@ swfdec_action_get_target (SwfdecAsContex
#if 0
static void
-swfdec_action_push_string (SwfdecAsContext *cx, const char *s)
-{
- JSString *string = JS...
2007 Sep 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_scope.c libswfdec/swfdec_as_scope.h libswfdec/swfdec_as_script_function.c
...lue, default_flags);
+}
+
SwfdecAsDeleteReturn
swfdec_as_frame_delete_variable (SwfdecAsFrame *frame, const char *variable)
{
@@ -721,25 +748,14 @@ swfdec_as_frame_preload (SwfdecAsFrame *
}
}
if (script->flags & SWFDEC_SCRIPT_PRELOAD_ROOT && current_reg < script->n_registers) {
- SwfdecAsObject *obj;
-
- obj = swfdec_as_frame_find_variable (frame, SWFDEC_AS_STR__root);
- if (obj) {
- swfdec_as_object_get_variable (obj, SWFDEC_AS_STR__root, &frame->registers[current_reg]);
- } else {
+ if (!swfdec_as_frame_get_variable (frame, SWFDEC_AS...
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
...ude "swfdec_as_context.h"
+#include "swfdec_as_stack.h"
#include "swfdec_debug.h"
G_DEFINE_TYPE (SwfdecAsFrame, swfdec_as_frame, SWFDEC_TYPE_AS_OBJECT)
@@ -34,6 +35,7 @@ swfdec_as_frame_dispose (GObject *object
g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers);
swfdec_script_unref (frame->script);
+ swfdec_as_stack_free (frame->stack);
G_OBJECT_CLASS (swfdec_as_frame_parent_class)->dispose (object);
}
@@ -50,6 +52,7 @@ swfdec_as_frame_mark (SwfdecAsObject *ob
for (i = 0; i < frame->n_registers; i++) {...
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
...e *scope = frame->scope ? frame->scope : SWFDEC_AS_SCOPE (frame);
- while (scope->next)
- scope = scope->next;
- fun = swfdec_as_script_function_new (scope, frame->target);
- }
- if (fun == NULL)
- return;
n_args = swfdec_bits_get_u16 (&bits);
if (v2) {
n_registers = swfdec_bits_get_u8 (&bits);
@@ -1565,7 +1553,18 @@ swfdec_action_define_function (SwfdecAsC
script->n_registers = n_registers;
script->n_arguments = n_args;
script->arguments = args;
- SWFDEC_AS_SCRIPT_FUNCTION (fun)->script = script;
+ /* see function-scope tests */...
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
...a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 73907ee..7b5d231 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;
diff-tree 4c21f27a1d0da5548142668069eecf835fadd541 (from 30dee9addcb7b3da9dbf00e260662acd648df851)
Author: Benjamin Otte <otte a...
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
...ts.
+ * This can be useful to find out about unimplemented native properties,
+ * but usually just causes a lot of spam. */
+//#define SWFDEC_WARN_MISSING_PROPERTIES
+
+/*** SUPPORT FUNCTIONS ***/
+
+#define swfdec_action_has_register(cx, i) \
+ ((i) < ((SwfdecScript *) (cx)->fp->swf)->n_registers)
+
+static SwfdecMovie *
+swfdec_action_get_target (SwfdecAsContext *context)
+{
+ SwfdecAsObject *object = context->frame->scope;
+
+ if (!SWFDEC_IS_MOVIE (object)) {
+ SWFDEC_ERROR ("no valid target");
+ return NULL;
+ }
+ return SWFDEC_MOVIE (object);
+}
+
+#if 0
+st...
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
...;
- if (frame->target)
- swfdec_as_object_mark (frame->target);
+ swfdec_as_object_mark (frame->target);
+ swfdec_as_object_mark (frame->original_target);
if (frame->function)
swfdec_as_object_mark (SWFDEC_AS_OBJECT (frame->function));
for (i = 0; i < frame->n_registers; i++) {
@@ -124,8 +121,6 @@ swfdec_as_frame_new (SwfdecAsContext *co
frame->pc = script->buffer->data;
frame->stack = stack;
frame->scope = SWFDEC_AS_SCOPE (frame);
- if (frame->next)
- frame->var_object = frame->next->var_object;
frame->n_registers...
2007 Jul 13
0
3 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...t * target; /* target to use as last object in scope chain or for SetVariable */
- SwfdecAsObject * original_target;/* original target (used when resetting target) */
- gboolean is_local; /* TRUE if this frame takes local variables */
- SwfdecAsValue * registers; /* the registers */
- guint n_registers; /* number of allocated registers */
- SwfdecConstantPool * constant_pool; /* constant pool currently in use */
- SwfdecBuffer * constant_pool_buffer; /* buffer containing the raw data for constant_pool */
- SwfdecAsValue * stack_begin; /* beginning of stack */
- guint8 * pc; /* program co...
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
...scope : SWFDEC_AS_SCOPE (frame);
while (scope->next)
scope = scope->next;
- fun = swfdec_as_function_new (scope);
+ fun = swfdec_as_script_function_new (scope);
}
if (fun == NULL)
return;
@@ -1342,7 +1343,7 @@ swfdec_action_define_function (SwfdecAsC
script->n_registers = n_registers;
script->n_arguments = n_args;
script->arguments = args;
- fun->script = script;
+ SWFDEC_AS_SCRIPT_FUNCTION (fun)->script = script;
swfdec_script_add_to_context (script, cx);
/* attach the function */
if (*function_name == '\0') {
diff --git a/...
2007 Aug 09
0
Branch 'vivi' - 12 commits - libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec/Makefile.am libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_debugger.c
...* FIXME: May want to typedef to SwfdecBuffer directly */
-struct _SwfdecScript {
- SwfdecBuffer * buffer; /* buffer holding the script */
- guint refcount; /* reference count */
- char * name; /* name identifying this script */
- guint version; /* version of the script */
- guint n_registers; /* number of registers */
- SwfdecBuffer * constant_pool; /* constant pool action */
- guint flags; /* SwfdecScriptFlags */
- guint n_arguments; /* number of arguments */
- SwfdecScriptArgument *arguments; /* arguments or NULL if none */
-};
-
-struct _SwfdecScriptArgument {
-...
2007 Oct 26
0
3 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_interpret.c
...wfdec/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 @@ swfdec_action_mb_ascii_to_char_5 (SwfdecAsContext *cx, guint action, const guint
}
static void
+swfdec_action_throw (Swfde...
2007 Oct 28
0
4 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_load_object.c
...@@ swfdec_as_frame_dispose (GObject *object)
{
SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object);
+ /* pop blocks while state is intact */
+ while (frame->blocks->len > 0)
+ swfdec_as_frame_pop_block (frame);
+
+ /* clean up */
g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers);
if (frame->security) {
g_object_unref (frame->security);
@@ -282,8 +290,6 @@ swfdec_as_frame_dispose (GObject *object)
swfdec_buffer_unref (frame->constant_pool_buffer);
frame->constant_pool_buffer = NULL;
}
- while (frame->blocks->l...
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
...swfdec_as_frame_mark (SwfdecAsObject *ob
swfdec_as_object_mark (SWFDEC_AS_OBJECT (frame->next));
swfdec_as_object_mark (frame->scope);
swfdec_as_object_mark (frame->var_object);
+ if (frame->target)
+ swfdec_as_object_mark (frame->target);
for (i = 0; i < frame->n_registers; i++) {
swfdec_as_value_mark (&frame->registers[i]);
}
@@ -143,24 +145,54 @@ swfdec_as_frame_new_native (SwfdecAsObje
SwfdecAsObject *
swfdec_as_frame_find_variable (SwfdecAsFrame *frame, const SwfdecAsValue *variable)
{
- SwfdecAsObject *ret = NULL;
+ SwfdecAsObject *cur, *r...
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
...ew frame for function %s", frame->function_name);
frame->pc = script->buffer->data;
frame->stack = stack;
- frame->scope = NULL;
+ frame->scope = SWFDEC_AS_SCOPE (frame);
if (frame->next)
frame->var_object = frame->next->var_object;
frame->n_registers = script->n_registers;
@@ -202,7 +202,7 @@ swfdec_as_frame_find_variable (SwfdecAsF
g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
g_return_val_if_fail (variable != NULL, NULL);
- cur = SWFDEC_AS_SCOPE (frame);
+ cur = frame->scope;
for (i = 0; i < 256; i++) {...
2007 Oct 11
0
12 commits - configure.ac doc/Makefile.am libswfdec/swfdec_as_frame.c libswfdec/swfdec_audio.c libswfdec/swfdec_audio_event.c libswfdec/swfdec_audio_event.h libswfdec/swfdec_shape_parser.c libswfdec/swfdec_sound.c test/sound
....c b/libswfdec/swfdec_as_frame.c
index 3812313..619811c 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -269,10 +269,6 @@ swfdec_as_frame_dispose (GObject *object
SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object);
g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers);
- if (frame->script) {
- swfdec_script_unref (frame->script);
- frame->script = NULL;
- }
if (frame->constant_pool) {
swfdec_constant_pool_free (frame->constant_pool);
frame->constant_pool = NULL;
@@ -285,6 +281,10 @@ swfdec_as_frame_...