mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Protect against null ctor
This should never happen, but if there's a null in the ctors list, don't just blindly call it.
This commit is contained in:
@@ -78,7 +78,7 @@ run_constructors()
|
|||||||
void (**p)(void) = &__ctors;
|
void (**p)(void) = &__ctors;
|
||||||
while (p < &__ctors_end) {
|
while (p < &__ctors_end) {
|
||||||
void (*ctor)(void) = *p++;
|
void (*ctor)(void) = *p++;
|
||||||
ctor();
|
if (ctor) ctor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,6 @@ kernel_main(args::header *header)
|
|||||||
extern cpu_data g_bsp_cpu_data;
|
extern cpu_data g_bsp_cpu_data;
|
||||||
extern uintptr_t idle_stack_end;
|
extern uintptr_t idle_stack_end;
|
||||||
|
|
||||||
|
|
||||||
cpu_data *cpu = &g_bsp_cpu_data;
|
cpu_data *cpu = &g_bsp_cpu_data;
|
||||||
kutil::memset(cpu, 0, sizeof(cpu_data));
|
kutil::memset(cpu, 0, sizeof(cpu_data));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user