Unsigned integer overflows in readelf checks
[deliverable/binutils-gdb.git] / gdb / varobj.c
index 3ae4de8bc14cce0fd8bef3fb18c5eca4af5396be..b03307068f30a4b3a1ff984cb4a539bb6848f024 100644 (file)
@@ -1,6 +1,6 @@
 /* Implementation of the GDB variable objects API.
 
-   Copyright (C) 1999-2018 Free Software Foundation, Inc.
+   Copyright (C) 1999-2019 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
 #include "gdb_regex.h"
 
 #include "varobj.h"
-#include "vec.h"
+#include "common/vec.h"
 #include "gdbthread.h"
 #include "inferior.h"
 #include "varobj-iter.h"
@@ -35,7 +35,6 @@
 #if HAVE_PYTHON
 #include "python/python.h"
 #include "python/python-internal.h"
-#include "python/py-ref.h"
 #else
 typedef int PyObject;
 #endif
@@ -1115,25 +1114,22 @@ install_default_visualizer (struct varobj *var)
 
   if (pretty_printing)
     {
-      PyObject *pretty_printer = NULL;
+      gdbpy_ref<> pretty_printer;
 
       if (var->value != nullptr)
        {
          pretty_printer = gdbpy_get_varobj_pretty_printer (var->value.get ());
-         if (! pretty_printer)
+         if (pretty_printer == nullptr)
            {
              gdbpy_print_stack ();
              error (_("Cannot instantiate printer for default visualizer"));
            }
        }
-      
+
       if (pretty_printer == Py_None)
-       {
-         Py_DECREF (pretty_printer);
-         pretty_printer = NULL;
-       }
+       pretty_printer.release ();
   
-      install_visualizer (var->dynamic, NULL, pretty_printer);
+      install_visualizer (var->dynamic, NULL, pretty_printer.release ());
     }
 }
 
This page took 0.026197 seconds and 4 git commands to generate.