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 (parent:
500a781
)
reactivated code_dup
author
kramm
<kramm>
Tue, 30 Dec 2008 22:55:03 +0000
(22:55 +0000)
committer
kramm
<kramm>
Tue, 30 Dec 2008 22:55:03 +0000
(22:55 +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
bb59ede
..
e92d6c9
100644
(file)
--- a/
lib/as3/code.c
+++ b/
lib/as3/code.c
@@
-1048,16
+1048,13
@@
code_t* code_append(code_t*code, code_t*toappend)
lookupswitch_t*lookupswitch_dup(lookupswitch_t*l)
{
lookupswitch_t*n = malloc(sizeof(lookupswitch_t));
lookupswitch_t*lookupswitch_dup(lookupswitch_t*l)
{
lookupswitch_t*n = malloc(sizeof(lookupswitch_t));
- fprintf(stderr, "lookupswitch dupping not supported yet\n");
+ fprintf(stderr, "Error: lookupswitch dupping not supported yet\n");
n->targets = list_clone(l->targets);
return 0;
}
code_t*code_dup(code_t*c)
{
n->targets = list_clone(l->targets);
return 0;
}
code_t*code_dup(code_t*c)
{
- /* misses branch relocation */
- fprintf(stderr, "dupping not supported yet\n");
- return 0;
if(!c) return 0;
while(c->prev) c = c->prev;
if(!c) return 0;
while(c->prev) c = c->prev;
@@
-1068,6
+1065,10
@@
code_t*code_dup(code_t*c)
memcpy(n, c, sizeof(code_t));
opcode_t*op = opcode_get(c->opcode);
memcpy(n, c, sizeof(code_t));
opcode_t*op = opcode_get(c->opcode);
+ if(c->branch) {
+ fprintf(stderr, "Error: Can't duplicate branching code\n");
+ return 0;
+ }
char*p = op?op->params:"";
int pos=0;
while(*p) {
char*p = op?op->params:"";
int pos=0;
while(*p) {
diff --git
a/lib/as3/code.h
b/lib/as3/code.h
index
885bfbe
..
6ae24b9
100644
(file)
--- a/
lib/as3/code.h
+++ b/
lib/as3/code.h
@@
-77,7
+77,7
@@
struct _codelookup {
int len;
};
int len;
};
-code_t*code_dup(code_t*c); //shallow copy
+code_t*code_dup(code_t*c);
code_t*add_opcode(code_t*atag, U8 op);
code_t*add_opcode(code_t*atag, U8 op);