[asterisk-bugs] [Asterisk 0016758]: [patch] zero/empty argument to gosub yields callers $ARG1

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Feb 3 04:26:23 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16758 
====================================================================== 
Reported By:                wdoekes
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16758
Category:                   Applications/app_stack
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 244392 
Request Review:              
====================================================================== 
Date Submitted:             2010-02-02 15:34 CST
Last Modified:              2010-02-03 04:26 CST
====================================================================== 
Summary:                    [patch] zero/empty argument to gosub yields callers
$ARG1
Description: 
Filed under app/app_stack as it's my most immediate problem, but it could
be filed under extensions.conf-parsing as well.

$ARG1..n behave like LOCAL() variables (I assume?). It's perfectly okay to
me that when I do not supply an Nth argument to a procedure, I get the
parents $ARGN instead. It is not okay, however, that my empty first
argument is ignored.

Two possible fixes:
- clean all the $ARGN's before entering the new frame (frame_set_var for
many arguments? expensive? not backward compatible)
- parse a zero-length argument list as one argument, not zero (depending
one where you do it, it could be okay)
====================================================================== 

---------------------------------------------------------------------- 
 (0117599) wdoekes (reporter) - 2010-02-03 04:26
 https://issues.asterisk.org/view.php?id=16758#c117599 
---------------------------------------------------------------------- 
That's probably better (more intuitive, less compatible).

I don't see any reason to use ~ARGC~ over ARGC though:
(1) no need to store max_argc. args2.argc is fine as we've cleaned up to
max_argc already
(2) both ~ARGC~ and ARGC are modifiable by the user, possibly yielding
unexpected results. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-02-03 04:26 wdoekes        Note Added: 0117599                          
======================================================================




More information about the asterisk-bugs mailing list