From 43781105062c9084231f063e63a9c47bd3c4b0a9 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Jan 2008 15:36:26 -0700 Subject: [PATCH] avoid type aliasing warnings --- src/posix.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/posix.cpp b/src/posix.cpp index 0042579a9f..887d5e73da 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -70,11 +70,13 @@ handleSignal(int signal, siginfo_t* info, void* context) if (signal == SegFaultSignal) { ucontext_t* c = static_cast(context); + void* ip = reinterpret_cast(IP_REGISTER(c)); + void* base = reinterpret_cast(BASE_REGISTER(c)); + void* stack = reinterpret_cast(STACK_REGISTER(c)); + void* thread = reinterpret_cast(THREAD_REGISTER(c)); + bool jump = segFaultHandler->handleSignal - (reinterpret_cast(&IP_REGISTER(c)), - reinterpret_cast(&BASE_REGISTER(c)), - reinterpret_cast(&STACK_REGISTER(c)), - reinterpret_cast(&THREAD_REGISTER(c))); + (&ip, &base, &stack, &thread); if (jump) { // I'd like to use setcontext here (and get rid of the @@ -88,10 +90,7 @@ handleSignal(int signal, siginfo_t* info, void* context) sigaddset(&set, SegFaultSignal); sigprocmask(SIG_UNBLOCK, &set, 0); - vmJump(reinterpret_cast(IP_REGISTER(c)), - reinterpret_cast(BASE_REGISTER(c)), - reinterpret_cast(STACK_REGISTER(c)), - reinterpret_cast(THREAD_REGISTER(c))); + vmJump(ip, base, stack, thread); } else if (oldSegFaultHandler.sa_flags & SA_SIGINFO) { oldSegFaultHandler.sa_sigaction(signal, info, context); } else if (oldSegFaultHandler.sa_handler) {