[asterisk-dev] [Code Review] Mask arguments of previous invocations of Gosub

Tilghman Lesher tlesher at digium.com
Tue Mar 16 18:47:17 CDT 2010



> On 2010-03-16 18:19:43, Mark Michelson wrote:
> > /trunk/tests/test_gosub.c, line 115
> > <https://reviewboard.asterisk.org/r/561/diff/1/?file=8698#file8698line115>
> >
> >     Using ast_stdup like this will cause a single-byte memory leak every time this test is run.

No, it won't.  See the very next argument for why it won't leak memory and the API description.


> On 2010-03-16 18:19:43, Mark Michelson wrote:
> > /trunk/tests/test_gosub.c, lines 121-125
> > <https://reviewboard.asterisk.org/r/561/diff/1/?file=8698#file8698line121>
> >
> >     You can break at this point.

I could, but I'd rather run the rest of the tests here.  The reason why we break out when an application fails to run is that the failure of an application will alter the results, but the reporting of those results should not be affected, as is the case here.


> On 2010-03-16 18:19:43, Mark Michelson wrote:
> > /trunk/tests/test_gosub.c, lines 96-99
> > <https://reviewboard.asterisk.org/r/561/diff/1/?file=8698#file8698line96>
> >
> >     I suppose this is worth discussing. Should failures that occur due to memory allocation prior to the real meat of the test be reported as a test failure or as done here with AST_TEST_NOT_RUN? I can see valid reasons for both ways, so I'll leave it up to someone else to make that decision.
> 
> Russell Bryant wrote:
>     Good catch.  I would actually like this to be AST_TEST_FAIL.

Changed.


- Tilghman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/561/#review1691
-----------------------------------------------------------


On 2010-03-16 17:45:49, Tilghman Lesher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/561/
> -----------------------------------------------------------
> 
> (Updated 2010-03-16 17:45:49)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> The current behavior of Gosub is that it does not mask out previous arguments.  The problem with this is that for any subroutine with optional arguments, arguments from previous stack levels could influence how the newest stack level executes.
> 
> 
> This addresses bug 16758.
>     https://issues.asterisk.org/view.php?id=16758
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_stack.c 252838 
>   /trunk/tests/test_gosub.c PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/561/diff
> 
> 
> Testing
> -------
> 
> Unit test written that verifies this new behavior, as well as verifying several other behaviors of the Gosub suite of applications.
> 
> 
> Thanks,
> 
> Tilghman
> 
>




More information about the asterisk-dev mailing list