+2014-02-07  Yao Qi  <yao@codesourcery.com>
+
+       * corefile.c (memory_error): Get 'exception' from ERR and pass
+       'exception' to throw_error.
+
 2014-02-06  Doug Evans  <xdje42@gmail.com>
 
        * configure.ac (libpython checking): Remove all but python.o from
 
 memory_error (enum target_xfer_error err, CORE_ADDR memaddr)
 {
   char *str;
+  enum errors exception = GDB_NO_ERROR;
 
   /* Build error string.  */
   str = memory_error_message (err, target_gdbarch (), memaddr);
   switch (err)
     {
     case TARGET_XFER_E_IO:
-      err = MEMORY_ERROR;
+      exception = MEMORY_ERROR;
       break;
     case TARGET_XFER_E_UNAVAILABLE:
-      err = NOT_AVAILABLE_ERROR;
+      exception = NOT_AVAILABLE_ERROR;
       break;
     }
 
   /* Throw it.  */
-  throw_error (err, ("%s"), str);
+  throw_error (exception, ("%s"), str);
 }
 
 /* Same as target_read_memory, but report an error if can't read.  */