2009-11-10 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Tue, 10 Nov 2009 10:05:47 +0000 (10:05 +0000)
committerTristan Gingold <gingold@adacore.com>
Tue, 10 Nov 2009 10:05:47 +0000 (10:05 +0000)
* avr-tdep.c (avr_make_saddr): Return 0 for NULL.

gdb/ChangeLog
gdb/avr-tdep.c

index f532d4bca8233ffab6a270ce7c58427eda53d778..b7b8d56658a4bc6ee0aa34fe613e660b4cc9f5f9 100644 (file)
@@ -1,3 +1,7 @@
+2009-11-10  Tristan Gingold  <gingold@adacore.com>
+
+       * avr-tdep.c (avr_make_saddr): Return 0 for NULL.
+
 2009-11-10  Tristan Gingold  <gingold@adacore.com>
 
        * avr-tdep.c (avr_dwarf_reg_to_regnum): New function.
index 6d04e56684cb09fae2548806aa883568c010f1c3..6de10f2d1e562716a21bee732afa2514aab68363 100644 (file)
@@ -240,6 +240,10 @@ avr_convert_iaddr_to_raw (CORE_ADDR x)
 static CORE_ADDR
 avr_make_saddr (CORE_ADDR x)
 {
+  /* Return 0 for NULL.  */
+  if (x == 0)
+    return 0;
+
   return ((x) | AVR_SMEM_START);
 }