Summary:ASTERISK-07438: For loop increment not working right
Reporter:Steve Murphy (murf)Labels:
Date Opened:2006-08-01 12:37:17Date Closed:2006-08-01 14:10:52
Versions:Frequency of
Description:A space in the for loop mucks up setting the variable increment!
This was brought out by Garstang in the asterisk-users mailing list.

****** STEPS TO REPRODUCE ******

Entering this into your AEL dialplan:

       771 => {
               for(i=0; ${i} <= 3; i = ${i} + 1 )
                       NoOp(i is '${i}');

Will deal death and destruction to your asterisk server when you dial 771.

Best to enter as:

       772 => {
               for(i=0; ${i} <= 3;i= ${i} + 1 )
                       NoOp(i is '${i}');

because the generated code looks like: Set( i=$[ ${i} + 1 ]); in the first case.
Comments:By: Steve Murphy (murf) 2006-08-01 12:41:59

I will acknowledge this, because I reported it, and I'm able to.

By: Steve Murphy (murf) 2006-08-01 12:42:52

I'm also confirming this one. Did the tests myself.

By: Steve Murphy (murf) 2006-08-01 14:09:59

I created branch teams/murf/bug_7635, and fixed the bug, then
merged that branch back into trunk.

This should resolve this issue.

By: Steve Murphy (murf) 2006-08-01 14:10:52

Since this bug is resolved, merged into trunk, it seems only appropriate to close it!