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:
cb219da
)
code_append now always returns the last statement in the list
author
kramm
<kramm>
Tue, 9 Dec 2008 13:39:16 +0000
(13:39 +0000)
committer
kramm
<kramm>
Tue, 9 Dec 2008 13:39:16 +0000
(13:39 +0000)
lib/as3/code.c
patch
|
blob
|
history
diff --git
a/lib/as3/code.c
b/lib/as3/code.c
index
86bae59
..
cb39096
100644
(file)
--- a/
lib/as3/code.c
+++ b/
lib/as3/code.c
@@
-995,12
+995,21
@@
void codestats_print(codestats_t*stats)
printf("scope_depth: %d\n", stats->max_scope_depth);
}
printf("scope_depth: %d\n", stats->max_scope_depth);
}
+code_t* code_end(code_t*code)
+{
+ if(!code)
+ return 0;
+ while(code->next)
+ code = code->next;
+ return code;
+}
+
code_t* code_append(code_t*code, code_t*toappend)
{
if(!code)
code_t* code_append(code_t*code, code_t*toappend)
{
if(!code)
- return toappend;
+ return code_end(toappend);
if(!toappend)
if(!toappend)
- return code;
+ return code_end(code);
//find end of first list
while(code->next) {
code = code->next;
//find end of first list
while(code->next) {
code = code->next;
@@
-1012,6
+1021,6
@@
code_t* code_append(code_t*code, code_t*toappend)
}
code->next = start;
start->prev = code;
}
code->next = start;
start->prev = code;
- return toappend;
+ return code_end(toappend);
}
}