]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
loader: Add volatile to resource_being_loaded.
authorCorey Farrell <git@cfware.com>
Sun, 24 Dec 2017 04:51:13 +0000 (23:51 -0500)
committerCorey Farrell <git@cfware.com>
Sun, 24 Dec 2017 05:44:01 +0000 (23:44 -0600)
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

main/loader.c

index 2a203c6a7ffcb0ee9d13029507b318ff4f2d5fb8..a6a87a01a8681e603c94b993c3f65782466ff150 100644 (file)
@@ -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