Commit c4e38581 authored by Eli Zaretskii's avatar Eli Zaretskii

Avoid aborts due to unaligned byte stack of threads

* src/thread.c (run_thread): Make sure the pointers to thread byte
stack are properly aligned.  (Bug#25247)
parent a978d300
......@@ -643,12 +643,19 @@ do_nothing (Lisp_Object whatever)
static void *
run_thread (void *state)
{
char stack_pos;
/* Make sure stack_top and m_stack_bottom are properly aligned as GC
expects. */
union
{
void *p;
char c;
} stack_pos;
struct thread_state *self = state;
struct thread_state **iter;
self->m_stack_bottom = &stack_pos;
self->stack_top = &stack_pos;
self->m_stack_bottom = &stack_pos.c;
self->stack_top = &stack_pos.c;
self->thread_id = sys_thread_self ();
acquire_global_lock (self);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment