Merge git://factorcode.org/git/factor
commit
f8d1ba029f
|
@ -1 +1,9 @@
|
||||||
|
#include <ucontext.h>
|
||||||
|
|
||||||
|
INLINE void *ucontext_stack_pointer(void *uap)
|
||||||
|
{
|
||||||
|
ucontext_t *ucontext = (ucontext_t *)uap;
|
||||||
|
return (void *)ucontext->uc_mcontext.mc_esp;
|
||||||
|
}
|
||||||
|
|
||||||
#define UAP_PROGRAM_COUNTER(ucontext) (((ucontext_t *)(ucontext))->uc_mcontext.mc_eip)
|
#define UAP_PROGRAM_COUNTER(ucontext) (((ucontext_t *)(ucontext))->uc_mcontext.mc_eip)
|
||||||
|
|
|
@ -1,2 +1,10 @@
|
||||||
|
#include <ucontext.h>
|
||||||
|
|
||||||
|
INLINE void *ucontext_stack_pointer(void *uap)
|
||||||
|
{
|
||||||
|
ucontext_t *ucontext = (ucontext_t *)uap;
|
||||||
|
return (void *)ucontext->uc_mcontext.gregs[7];
|
||||||
|
}
|
||||||
|
|
||||||
#define UAP_PROGRAM_COUNTER(ucontext) \
|
#define UAP_PROGRAM_COUNTER(ucontext) \
|
||||||
(((ucontext_t *)(ucontext))->uc_mcontext.gregs[14])
|
(((ucontext_t *)(ucontext))->uc_mcontext.gregs[14])
|
||||||
|
|
|
@ -192,7 +192,12 @@ INLINE F_STACK_FRAME *uap_stack_pointer(void *uap)
|
||||||
from Factor to C is a sign of things seriously gone wrong, not just
|
from Factor to C is a sign of things seriously gone wrong, not just
|
||||||
a divide by zero or stack underflow in the listener */
|
a divide by zero or stack underflow in the listener */
|
||||||
if(in_code_heap_p(UAP_PROGRAM_COUNTER(uap)))
|
if(in_code_heap_p(UAP_PROGRAM_COUNTER(uap)))
|
||||||
return ucontext_stack_pointer(uap);
|
{
|
||||||
|
F_STACK_FRAME *ptr = ucontext_stack_pointer(uap);
|
||||||
|
if(!ptr)
|
||||||
|
critical_error("Invalid uap",(CELL)uap);
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#define FACTOR_OS_STRING "freebsd"
|
#define FACTOR_OS_STRING "freebsd"
|
||||||
#include "os-freebsd.h"
|
#include "os-freebsd.h"
|
||||||
#include "os-unix-ucontext.h"
|
|
||||||
|
|
||||||
#if defined(FACTOR_X86)
|
#if defined(FACTOR_X86)
|
||||||
#include "os-freebsd-x86.32.h"
|
#include "os-freebsd-x86.32.h"
|
||||||
|
@ -64,7 +63,6 @@
|
||||||
#include "os-linux.h"
|
#include "os-linux.h"
|
||||||
|
|
||||||
#if defined(FACTOR_X86)
|
#if defined(FACTOR_X86)
|
||||||
#include "os-unix-ucontext.h"
|
|
||||||
#include "os-linux-x86-32.h"
|
#include "os-linux-x86-32.h"
|
||||||
#elif defined(FACTOR_PPC)
|
#elif defined(FACTOR_PPC)
|
||||||
#include "os-unix-ucontext.h"
|
#include "os-unix-ucontext.h"
|
||||||
|
|
Loading…
Reference in New Issue