Fixes for gdb.xml/tdesc-regs.exp.
[deliverable/binutils-gdb.git] / sim / arm / armos.c
index c49036f1224246e257e339818efd0539b6b7e9d3..76c449b73d0f7dd4b69fe32de97056fb354c0efd 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "config.h"
 #include "ansidecl.h"
+#include "libiberty.h"
 
 #include <time.h>
 #include <errno.h>
@@ -260,7 +261,10 @@ SWIopen (ARMul_State * state, ARMword name, ARMword SWIflags)
     return;
 
   /* Now we need to decode the Demon open mode.  */
-  flags = translate_open_mode[SWIflags];
+  if (SWIflags >= ARRAY_SIZE (translate_open_mode))
+    flags = 0;
+  else
+    flags = translate_open_mode[SWIflags];
 
   /* Filename ":tt" is special: it denotes stdin/out.  */
   if (strcmp (buf, ":tt") == 0)
This page took 0.257939 seconds and 4 git commands to generate.