[Asterisk-code-review] res_ael: Create consistent label names across reloads (...asterisk[16])

George Joseph asteriskteam at digium.com
Fri Apr 12 14:16:27 CDT 2019


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11271 )

Change subject: res_ael: Create consistent label names across reloads
......................................................................

res_ael: Create consistent label names across reloads

Reset the internal counter that the AEL2 compiler uses for unique label
names before compiling. This keeps dialplan labels consistent across
reloads assuming the AEL2 has not changed.

ASTERISK-17799 #close
Reported by: Kirill Katsnelson

Change-Id: I30b3cc887d1ee0644d3f341e2fef16f525d7fae5
---
M res/ael/pval.c
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/res/ael/pval.c b/res/ael/pval.c
index f927077..095cb88 100644
--- a/res/ael/pval.c
+++ b/res/ael/pval.c
@@ -2924,7 +2924,7 @@
 /* "CODE" GENERATOR -- Convert the AEL representation to asterisk extension language */
 /* =============================================================================================== */
 
-static int control_statement_count = 0;
+static int control_statement_count;
 
 struct ael_priority *new_prio(void)
 {
@@ -4427,6 +4427,9 @@
 	struct ael_extension *exten;
 	struct ael_extension *exten_list = 0;
 
+	/* Reset the counter so that we get consistent labels between reloads */
+	control_statement_count = 0;
+
 	for (p=root; p; p=p->next ) { /* do the globals first, so they'll be there
 									 when we try to eval them */
 		switch (p->type) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11271
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I30b3cc887d1ee0644d3f341e2fef16f525d7fae5
Gerrit-Change-Number: 11271
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190412/be3224e2/attachment.html>


More information about the asterisk-code-review mailing list