From b028568f77080aaf1afa1e1c699fa9c1746117d4 Mon Sep 17 00:00:00 2001 From: kramm Date: Tue, 30 Dec 2008 22:52:28 +0000 Subject: [PATCH] mind NEED_REST when calculating local variable usage --- lib/as3/abc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 1.7.10.4