X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fabc.c;h=2f84f5aed15b988766a821405018eb7b77529c67;hb=b028568f77080aaf1afa1e1c699fa9c1746117d4;hp=e7690c3e109bb516bf51c495a79ae6728bcf01ab;hpb=bdea56b0a41aab175d3ce2852cfbfcf11b068f1d;p=swftools.git diff --git a/lib/as3/abc.c b/lib/as3/abc.c index e7690c3..2f84f5a 100644 --- a/lib/as3/abc.c +++ b/lib/as3/abc.c @@ -1091,10 +1091,15 @@ void swf_WriteABC(TAG*abctag, void*code) //swf_SetU30(tag, c->old.max_scope_depth); swf_SetU30(tag, c->stats->max_stack); - if(list_length(c->method->parameters)+1 <= c->stats->local_count) + + int param_num = list_length(c->method->parameters)+1; + if(c->method->flags&METHOD_NEED_REST) + param_num++; + if(param_num <= c->stats->local_count) swf_SetU30(tag, c->stats->local_count); else - swf_SetU30(tag, list_length(c->method->parameters)+1); + swf_SetU30(tag, param_num); + swf_SetU30(tag, c->init_scope_depth); swf_SetU30(tag, c->stats->max_scope_depth+ c->init_scope_depth);