diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2017-12-28 02:27:07 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2017-12-28 02:27:07 +0500 |
commit | 287adbfc205c02eac375f55fb94f13c073faec97 (patch) | |
tree | ee7afe2bd94f0266f199c4f140481956c364d7cf /accel-pppd/triton | |
parent | d7c91b0e301375c06feecbb2e714b13860e2c35f (diff) | |
download | accel-ppp-287adbfc205c02eac375f55fb94f13c073faec97.tar.gz accel-ppp-287adbfc205c02eac375f55fb94f13c073faec97.zip |
triton: fix crash due gcc mis-optimization of alloca()
since alloca() result is used indirectly, gcc 4.7.2 thinks
the whole call can be dropped on any optimization level.
Diffstat (limited to 'accel-pppd/triton')
-rw-r--r-- | accel-pppd/triton/triton.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c index 64ca7b8f..a4567464 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(); |