From f5c30dd323a3c575bf0ca3147691647c55e6cbfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 13 Mar 2007 00:32:48 +0000 Subject: [PATCH] added checks to trick the gcc4 compiler. this way the label is kept. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20380 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_cpu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/system/kernel/arch/x86/arch_cpu.c b/src/system/kernel/arch/x86/arch_cpu.c index ff12cda9c4..7c8a68752e 100644 --- a/src/system/kernel/arch/x86/arch_cpu.c +++ b/src/system/kernel/arch/x86/arch_cpu.c @@ -587,6 +587,10 @@ arch_cpu_user_memcpy(void *to, const void *from, size_t size, addr_t *faultHandl char *tmp = (char *)to; char *s = (char *)from; + // this check is to trick the gcc4 compiler and have it keep the error label + if (to == NULL) + goto error; + *faultHandler = (addr_t)&&error; while (size--) @@ -606,6 +610,10 @@ arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr_t *faultHand { int fromLength = 0; + // this check is to trick the gcc4 compiler and have it keep the error label + if (to == NULL) + goto error; + *faultHandler = (addr_t)&&error; if (size > 0) { @@ -635,6 +643,10 @@ arch_cpu_user_memset(void *s, char c, size_t count, addr_t *faultHandler) { char *xs = (char *)s; + // this check is to trick the gcc4 compiler and have it keep the error label + if (s == NULL) + goto error; + *faultHandler = (addr_t)&&error; while (count--)