mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-23 19:21:59 +03:00
Execute global constructors in correct order (#2074)
Walk .ctors array from back to front, like gcc's gbl-ctors.h does
This commit is contained in:
@ -119,9 +119,9 @@ static void loop_task(os_event_t *events) {
|
||||
}
|
||||
|
||||
static void do_global_ctors(void) {
|
||||
void (**p)(void);
|
||||
for(p = &__init_array_start; p != &__init_array_end; ++p)
|
||||
(*p)();
|
||||
void (**p)(void) = &__init_array_end;
|
||||
while (p != &__init_array_start)
|
||||
(*--p)();
|
||||
}
|
||||
|
||||
extern "C" void __gdb_init() {}
|
||||
|
Reference in New Issue
Block a user