aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-07-27 19:31:30 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-07-27 19:31:30 +0000
commit18a46dbee88ecb499c299673eb50a4d9cdaaefaa (patch)
tree652ba8ac5279f521de7b34f86a010738355cc38a /gdb/valops.c
parentbb7da2bfb5d890bdb01a15ed46a64011fc08d812 (diff)
downloadgdb-18a46dbee88ecb499c299673eb50a4d9cdaaefaa.zip
gdb-18a46dbee88ecb499c299673eb50a4d9cdaaefaa.tar.gz
gdb-18a46dbee88ecb499c299673eb50a4d9cdaaefaa.tar.bz2
gdb/
2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <pedro@codesourcery.com> * eval.c (evaluate_subexp_standard): Remove not_lval from all calls of value_one. * valops.c (value_one): Remove parameter lv. Do not pass it to itself. Assert the result kind. * value.h (value_one): Remove parameter lv.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index ee05d73..cd40c22 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -864,10 +864,10 @@ value_zero (struct type *type, enum lval_type lv)
return val;
}
-/* Create a value of numeric type TYPE that is one, and return it. */
+/* Create a not_lval value of numeric type TYPE that is one, and return it. */
struct value *
-value_one (struct type *type, enum lval_type lv)
+value_one (struct type *type)
{
struct type *type1 = check_typedef (type);
struct value *val;
@@ -901,7 +901,7 @@ value_one (struct type *type, enum lval_type lv)
val = allocate_value (type);
for (i = 0; i < high_bound - low_bound + 1; i++)
{
- tmp = value_one (eltype, lv);
+ tmp = value_one (eltype);
memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
value_contents_all (tmp), TYPE_LENGTH (eltype));
}
@@ -911,7 +911,9 @@ value_one (struct type *type, enum lval_type lv)
error (_("Not a numeric type."));
}
- VALUE_LVAL (val) = lv;
+ /* value_one result is never used for assignments to. */
+ gdb_assert (VALUE_LVAL (val) == not_lval);
+
return val;
}