From: kramm Date: Tue, 30 Dec 2008 22:52:28 +0000 (+0000) Subject: mind NEED_REST when calculating local variable usage X-Git-Tag: release-0-9-0~571 X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;ds=sidebyside;h=b028568f77080aaf1afa1e1c699fa9c1746117d4;p=swftools.git mind NEED_REST when calculating local variable usage --- 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);