diff options
-rw-r--r-- | awkgram.y | 2 | ||||
-rw-r--r-- | symbol.c | 5 |
2 files changed, 5 insertions, 2 deletions
@@ -5208,7 +5208,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def) /* update lint table info */ func_use(thisfunc->vname, FUNC_DEFINE); - /* remove params/locals from symbol table */ + /* remove params from symbol table */ remove_locals(thisfunc); return fi; } @@ -266,7 +266,10 @@ remove_locals(NODE *func) assert(func->type == Node_func); - if ( (pcount = func->frame_cnt) <= 0 + /* Only remove up to param_cnt. The @let locals from param_cnt to frame_cnt + * should have already been removed by the parser. + */ + if ( (pcount = func->param_cnt) <= 0 || (parms = func->fparms) == NULL) return; |