* Fix Garbage Collector for missing calle-saved regs content (Bug#41357)
* src/alloc.c (SET_STACK_TOP_ADDRESS): Do not call __builtin_unwind_init. (flush_stack_call_func1): Rename from 'flush_stack_call_func'. (flush_stack_call_func): New function to spill all registers before calling 'flush_stack_call_func1'. This to make sure the top of the stack identified includes those registers.
This commit is contained in:
parent
5daa7a5fd4
commit
abec255c02
2 changed files with 10 additions and 4 deletions
|
@ -4944,12 +4944,10 @@ typedef union
|
||||||
#ifdef HAVE___BUILTIN_UNWIND_INIT
|
#ifdef HAVE___BUILTIN_UNWIND_INIT
|
||||||
# define SET_STACK_TOP_ADDRESS(p) \
|
# define SET_STACK_TOP_ADDRESS(p) \
|
||||||
stacktop_sentry sentry; \
|
stacktop_sentry sentry; \
|
||||||
__builtin_unwind_init (); \
|
|
||||||
*(p) = NEAR_STACK_TOP (&sentry)
|
*(p) = NEAR_STACK_TOP (&sentry)
|
||||||
#else
|
#else
|
||||||
# define SET_STACK_TOP_ADDRESS(p) \
|
# define SET_STACK_TOP_ADDRESS(p) \
|
||||||
stacktop_sentry sentry; \
|
stacktop_sentry sentry; \
|
||||||
__builtin_unwind_init (); \
|
|
||||||
test_setjmp (); \
|
test_setjmp (); \
|
||||||
sys_setjmp (sentry.j); \
|
sys_setjmp (sentry.j); \
|
||||||
*(p) = NEAR_STACK_TOP (&sentry + (stack_bottom < &sentry.c))
|
*(p) = NEAR_STACK_TOP (&sentry + (stack_bottom < &sentry.c))
|
||||||
|
@ -5025,7 +5023,7 @@ mark_stack (char const *bottom, char const *end)
|
||||||
from FUNC. */
|
from FUNC. */
|
||||||
|
|
||||||
NO_INLINE void
|
NO_INLINE void
|
||||||
flush_stack_call_func (void (*func) (void *arg), void *arg)
|
flush_stack_call_func1 (void (*func) (void *arg), void *arg)
|
||||||
{
|
{
|
||||||
void *end;
|
void *end;
|
||||||
struct thread_state *self = current_thread;
|
struct thread_state *self = current_thread;
|
||||||
|
|
10
src/lisp.h
10
src/lisp.h
|
@ -3811,7 +3811,15 @@ extern void alloc_unexec_pre (void);
|
||||||
extern void alloc_unexec_post (void);
|
extern void alloc_unexec_post (void);
|
||||||
extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t);
|
extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t);
|
||||||
extern void mark_stack (char const *, char const *);
|
extern void mark_stack (char const *, char const *);
|
||||||
extern void flush_stack_call_func (void (*func) (void *arg), void *arg);
|
extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg);
|
||||||
|
|
||||||
|
INLINE void
|
||||||
|
flush_stack_call_func (void (*func) (void *arg), void *arg)
|
||||||
|
{
|
||||||
|
__builtin_unwind_init ();
|
||||||
|
flush_stack_call_func1 (func, arg);
|
||||||
|
}
|
||||||
|
|
||||||
extern void garbage_collect (void);
|
extern void garbage_collect (void);
|
||||||
extern void maybe_garbage_collect (void);
|
extern void maybe_garbage_collect (void);
|
||||||
extern const char *pending_malloc_warning;
|
extern const char *pending_malloc_warning;
|
||||||
|
|
Loading…
Add table
Reference in a new issue