diff mbox

[10/15] mips: null pointer deref should segfault

Message ID e6e5bd2dd1868b5a244bc572422f585cef579ffb.1310568214.git.riku.voipio@linaro.org
State New
Headers show

Commit Message

Riku Voipio July 13, 2011, 2:48 p.m. UTC
From: Wesley W. Terpstra <terpstra@debian.org>

Dereferencing a null pointer causes an exception 0xC (EXCP_AdEL)
instead of EXCP_TLBL. This should also trigger a segfault.

Signed-off-by: Wesley W. Terpstra <terpstra@debian.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index e32f987..2135b9c 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2120,6 +2120,8 @@  void cpu_loop(CPUMIPSState *env)
             break;
         case EXCP_TLBL:
         case EXCP_TLBS:
+        case EXCP_AdEL:
+        case EXCP_AdES:
             info.si_signo = TARGET_SIGSEGV;
             info.si_errno = 0;
             /* XXX: check env->error_code */