Skip to content

Commit

Permalink
loader: Add volatile to resource_being_loaded.
Browse files Browse the repository at this point in the history
Some compiler optimizers seem to assume that dlopen will not use
__attribute__((constructor)) functions to call back to the program.
This was causing resource_being_loaded to be optimized away completely.

ASTERISK-27531 #close
Tested By: abelbeck

Change-Id: If17a3b889e06811a0e7119f0539d052494d6ece9
  • Loading branch information
coreyfarrell committed Dec 24, 2017
1 parent 5533065 commit 23aa20b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main/loader.c
Expand Up @@ -198,7 +198,7 @@ static AST_DLLIST_HEAD_STATIC(reload_queue, reload_queue_item);
*
* This is protected by the module_list lock.
*/
static struct ast_module *resource_being_loaded;
static struct ast_module * volatile resource_being_loaded;

/*!
* \internal
Expand Down

0 comments on commit 23aa20b

Please sign in to comment.