git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b66793a
)
added flags generation
author
kramm
<kramm>
Mon, 24 Nov 2008 16:13:37 +0000
(16:13 +0000)
committer
kramm
<kramm>
Mon, 24 Nov 2008 16:13:37 +0000
(16:13 +0000)
lib/as3/code.c
patch
|
blob
|
history
lib/as3/code.h
patch
|
blob
|
history
diff --git
a/lib/as3/code.c
b/lib/as3/code.c
index
0c97998
..
ed59d22
100644
(file)
--- a/
lib/as3/code.c
+++ b/
lib/as3/code.c
@@
-526,6
+526,7
@@
typedef struct {
int maxlocal;
int maxstack;
int maxscope;
int maxlocal;
int maxstack;
int maxscope;
+ int flags;
} currentstats_t;
static int stack_minus(code_t*c)
} currentstats_t;
static int stack_minus(code_t*c)
@@
-620,6
+621,11
@@
static char callcode(currentstats_t*stats, int pos, int stack, int scope)
stats->maxstack = stack;
if(scope > stats->maxscope)
stats->maxscope = scope;
stats->maxstack = stack;
if(scope > stats->maxscope)
stats->maxscope = scope;
+
+ if(op->flags & OP_SET_DXNS)
+ stats->flags |= FLAGS_SET_DXNS;
+ if(op->flags & OP_NEED_ACTIVATION)
+ stats->flags |= FLAGS_ACTIVATION;
if(op->flags & OP_REGISTER) {
char*p = op->params;
if(op->flags & OP_REGISTER) {
char*p = op->params;
@@
-708,6
+714,7
@@
static currentstats_t* code_get_stats(code_t*code, exception_list_t*exceptions)
current->maxstack = 0;
current->maxscope = 0;
current->num = num;
current->maxstack = 0;
current->maxscope = 0;
current->num = num;
+ current->flags = 0;
//#define DEBUG_BYTES
#ifdef DEBUG_BYTES
//#define DEBUG_BYTES
#ifdef DEBUG_BYTES
@@
-888,11
+895,12
@@
codestats_t* code_get_statistics(code_t*code, exception_list_t*exceptions)
currentstats_t*current = code_get_stats(code, exceptions);
if(!current)
return 0;
currentstats_t*current = code_get_stats(code, exceptions);
if(!current)
return 0;
- codestats_t*stats = malloc(sizeof(codestats_t));
+ codestats_t*stats = rfx_calloc(sizeof(codestats_t));
stats->local_count = current->maxlocal;
stats->max_stack = current->maxstack;
stats->init_scope_depth = 0;
stats->max_scope_depth = current->maxscope;
stats->local_count = current->maxlocal;
stats->max_stack = current->maxstack;
stats->init_scope_depth = 0;
stats->max_scope_depth = current->maxscope;
+ stats->flags = current->flags;
stats_free(current);current=0;
return stats;
stats_free(current);current=0;
return stats;
diff --git
a/lib/as3/code.h
b/lib/as3/code.h
index
5d94611
..
6cf00f3
100644
(file)
--- a/
lib/as3/code.h
+++ b/
lib/as3/code.h
@@
-40,11
+40,14
@@
struct _lookupswitch {
code_list_t*targets;
};
code_list_t*targets;
};
+#define FLAGS_ACTIVATION 0x02
+#define FLAGS_SET_DXNS 0x40
struct _codestats {
int max_stack;
int local_count;
int init_scope_depth;
int max_scope_depth;
struct _codestats {
int max_stack;
int local_count;
int init_scope_depth;
int max_scope_depth;
+ int flags;
};
struct _codelookup {
};
struct _codelookup {