aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-12-12 23:25:46 -0800
committerDoug Evans <xdje42@gmail.com>2014-12-12 23:25:46 -0800
commitae6a105d22fb603dbfb956bbcedf9ae469323d55 (patch)
tree66e9b8be45244d096bbfdbb4314951f82fb2154d
parent59da4d04cbce4d4209f7e88f8fc3532ef289a99e (diff)
downloadgdb-ae6a105d22fb603dbfb956bbcedf9ae469323d55.zip
gdb-ae6a105d22fb603dbfb956bbcedf9ae469323d55.tar.gz
gdb-ae6a105d22fb603dbfb956bbcedf9ae469323d55.tar.bz2
value_maybe_namespace_elt: Remove unnecessary test of result != NULL.
Both allocate_value and value_of_variable are guaranteed to return non-NULL. gdb/ChangeLog: * valops.c (value_maybe_namespace_elt): Remove unnecessary test of result != NULL.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/valops.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f2bdec7..45e2fb5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2014-12-12 Doug Evans <xdje42@gmail.com>
+ * valops.c (value_maybe_namespace_elt): Remove unnecessary test of
+ result != NULL.
+
+2014-12-12 Doug Evans <xdje42@gmail.com>
+
* cp-support.h (cp_is_in_anonymous): Renamed from cp_is_anonymous.
All callers updated. Rename arg "namespace" to "symbol_name".
diff --git a/gdb/valops.c b/gdb/valops.c
index 4125fc0..4d3059e 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3586,7 +3586,7 @@ value_maybe_namespace_elt (const struct type *curtype,
else
result = value_of_variable (sym, get_selected_block (0));
- if (result && want_address)
+ if (want_address)
result = value_addr (result);
return result;