summaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>2010-03-18 01:47:33 +0000
committerStan Shebs <shebs@apple.com>2010-03-18 01:47:33 +0000
commit8780a14a916cc43b8c25d084bcb30299c1e1a6e9 (patch)
tree4760a3e055995bf061ddb276a7a398aa195b9f0c /gdb/ax-gdb.c
parent8850d00dc9ce1059186667f577841ad5edd093b1 (diff)
downloadgdb-8780a14a916cc43b8c25d084bcb30299c1e1a6e9.tar.gz
2010-03-17 Stan Shebs <stan@codesourcery.com>
* ax-gdb.c (require_rvalue): Disallow non-scalars.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r--gdb/ax-gdb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 091fd95f1fc..4307de3acd6 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -745,6 +745,15 @@ gen_int_literal (struct agent_expr *ax, struct axs_value *value, LONGEST k,
static void
require_rvalue (struct agent_expr *ax, struct axs_value *value)
{
+ /* Only deal with scalars, structs and such may be too large
+ to fit in a stack entry. */
+ value->type = check_typedef (value->type);
+ if (TYPE_CODE (value->type) == TYPE_CODE_ARRAY
+ || TYPE_CODE (value->type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (value->type) == TYPE_CODE_UNION
+ || TYPE_CODE (value->type) == TYPE_CODE_FUNC)
+ error ("Value not scalar: cannot be an rvalue.");
+
switch (value->kind)
{
case axs_rvalue: