From 1856d6bbfe61c45b04ba20aeb41dd1dee29c9c6a Mon Sep 17 00:00:00 2001 From: Jo Van Bulck Date: Wed, 29 May 2024 19:38:52 +0000 Subject: [PATCH] app/memcmp: fix compilation on Ubuntu 20.04. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: main.c: In function ‘fault_handler’: main.c:134:9: error: a label can only be part of a statement and a declaration is not a statement --- app/memcmp/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/memcmp/main.c b/app/memcmp/main.c index 77342bb..54352b9 100644 --- a/app/memcmp/main.c +++ b/app/memcmp/main.c @@ -99,6 +99,8 @@ void aep_cb_func(void) /* Called upon SIGSEGV caused by untrusted page tables. */ void fault_handler(int signo, siginfo_t * si, void *ctx) { + ucontext_t *uc = (ucontext_t *) ctx; + switch ( signo ) { case SIGSEGV: @@ -131,7 +133,6 @@ void fault_handler(int signo, siginfo_t * si, void *ctx) #endif /* ensure RFLAGS.TF is clear to disable debug single-stepping */ - ucontext_t *uc = (ucontext_t *) ctx; uc->uc_mcontext.gregs[REG_EFL] &= ~0x100; break; #endif