From: Sean Bright Date: Thu, 11 Apr 2019 20:48:49 +0000 (-0400) Subject: res_ael: Create consistent label names across reloads X-Git-Tag: 17.0.0-rc1~109^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f827193424ab50b22c741b687bdc44934d0d6288;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/ael/pval.c b/res/ael/pval.c index f927077a83..095cb88581 100644 --- a/res/ael/pval.c +++ b/res/ael/pval.c @@ -2924,7 +2924,7 @@ void ael2_semantic_check(pval *item, int *arg_errs, int *arg_warns, int *arg_not /* "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 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo 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) {