* ax-gdb.c (gen_deref): Don't allow dereferencing void pointers.
authorPedro Alves <palves@redhat.com>
Thu, 11 Feb 2010 18:24:57 +0000 (18:24 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 11 Feb 2010 18:24:57 +0000 (18:24 +0000)
gdb/ChangeLog
gdb/ax-gdb.c

index acd65e83c841044dc282dad8c691943646fe07c6..ddf66153dbfa05fa72ecb294056db0e1060a82d3 100644 (file)
@@ -1,3 +1,7 @@
+2010-02-11  Pedro Alves  <pedro@codesourcery.com>
+
+       * ax-gdb.c (gen_deref): Don't allow dereferencing void pointers.
+
 2010-02-11  Vladimir Prus  <vladimir@codesourcery.com>
 
        * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Add extra
index 5776bb0ce6d9487dba27e69cb37e87a9c49a2198..eb532384ca660ae2a71edd98dbdd3ab3f55ed5c5 100644 (file)
@@ -1082,6 +1082,8 @@ gen_deref (struct agent_expr *ax, struct axs_value *value)
      T" to "T", and mark the value as an lvalue in memory.  Leave it
      to the consumer to actually dereference it.  */
   value->type = check_typedef (TYPE_TARGET_TYPE (value->type));
+  if (TYPE_CODE (value->type) == TYPE_CODE_VOID)
+    error (_("Attempt to dereference a generic pointer."));
   value->kind = ((TYPE_CODE (value->type) == TYPE_CODE_FUNC)
                 ? axs_rvalue : axs_lvalue_memory);
 }
This page took 0.028642 seconds and 4 git commands to generate.