* ax-gdb.c (gen_deref): Don't allow dereferencing void pointers.

This commit is contained in:
Pedro Alves 2010-02-11 18:24:57 +00:00
parent 24981e7b95
commit b1028c8e8f
2 changed files with 6 additions and 0 deletions

View 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

View 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);
}