X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fexpr.c;h=7a6d32c313605f76b52452b42d489fa76d7323c1;hb=ea87e32fc17cce0b6633b88df1855f538efe9652;hp=33afc0bca319f6563de41a4c4dae5a016dbb2447;hpb=f00ad28507322054abc4859cb2049ec6f807c0c8;p=swftools.git diff --git a/lib/as3/expr.c b/lib/as3/expr.c index 33afc0b..7a6d32c 100644 --- a/lib/as3/expr.c +++ b/lib/as3/expr.c @@ -1,4 +1,4 @@ -/* ast.c +/* expr.c Extension module for the rfxswf library. Part of the swftools package. @@ -90,16 +90,6 @@ static classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, nodetype_t*t return type1; return TYPE_ANY; } -static char is_getlocal(code_t*c) -{ - if(!c || c->prev || c->next) - return 0; - return(c->opcode == OPCODE_GETLOCAL - || c->opcode == OPCODE_GETLOCAL_0 - || c->opcode == OPCODE_GETLOCAL_1 - || c->opcode == OPCODE_GETLOCAL_2 - || c->opcode == OPCODE_GETLOCAL_3); -} static int getlocalnr(code_t*c) { if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];} @@ -2646,7 +2636,16 @@ exec: node_const_exec typedcode_t node_code_write(node_t*n) { - syntaxerror("not implemented yet"); + typedcode_t t; + t.c = 0; + int tmp = gettempvar(); + t.c = abc_setlocal(t.c, tmp); + code_t*w = toreadwrite(n->code.c, abc_getlocal(0,tmp), 1, 0, 0); + t.c = code_append(t.c, w); + t.c = abc_kill(t.c, tmp); + n->code.c=0; + t.t = n->code.t; + return t; } typedcode_t node_code_read(node_t*n) { @@ -2832,6 +2831,12 @@ typedcode_t node_read(node_t*n) return t; } } +typedcode_t node_write(node_t*n) +{ + typedcode_t t = n->type->write(n); + node_free(n); + return t; +} code_t* node_exec(node_t*n) { code_t*c = n->type->exec(n);