summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorxebd <xeb@mail.ru>2017-12-28 09:49:26 +0300
committerGitHub <noreply@github.com>2017-12-28 09:49:26 +0300
commit53d53606ba52032b4ae81c4c967316816053efcc (patch)
treeee7afe2bd94f0266f199c4f140481956c364d7cf /accel-pppd
parentd7c91b0e301375c06feecbb2e714b13860e2c35f (diff)
parent287adbfc205c02eac375f55fb94f13c073faec97 (diff)
downloadaccel-ppp-xebd-53d53606ba52032b4ae81c4c967316816053efcc.tar.gz
accel-ppp-xebd-53d53606ba52032b4ae81c4c967316816053efcc.zip
Merge pull request #30 from themiron/alloca-crash
triton: fix crash due gcc mis-optimization of alloca()
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/triton/triton.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c
index 64ca7b8..a456746 100644
--- a/accel-pppd/triton/triton.c
+++ b/accel-pppd/triton/triton.c
@@ -54,6 +54,7 @@ struct triton_context_t default_ctx;
static __thread struct triton_context_t *this_ctx;
static __thread jmp_buf jmp_env;
static __thread void *thread_frame;
+static volatile void *thread_stack;
#define log_debug2(fmt, ...)
@@ -133,7 +134,7 @@ static void* triton_thread(struct _triton_thread_t *thread)
if (this_ctx->before_switch)
this_ctx->before_switch(this_ctx, thread->ctx->bf_arg);
- alloca(thread->ctx->uc->uc_stack.ss_size + 64);
+ thread_stack = alloca(thread->ctx->uc->uc_stack.ss_size + 64);
memcpy(thread_frame - thread->ctx->uc->uc_stack.ss_size, thread->ctx->uc->uc_stack.ss_sp, thread->ctx->uc->uc_stack.ss_size);
setcontext(thread->ctx->uc);
abort();