This nullptr is pointless most of the time: almost all callers either
check that the prop is not nullptr or they pass the address of a local
variable, which is necessarily not nullptr. I propose to remove it. I
found only one call site where I needed to add a check.
Change-Id: Iada84d529b8edc6b20486f3539c675dad6b364f5
Approved-By: Tom Tromey <tom@tromey.com>
CORE_ADDR *value,
gdb::array_view<CORE_ADDR> push_values)
{
- if (prop == NULL)
- return false;
-
/* Evaluating a property should not change the current language.
Without this here this could happen if the code below selects a
frame. */
/* Resolve the rank property to get rank value. */
struct dynamic_prop *prop = type->dyn_prop (DYN_PROP_RANK);
- if (dwarf2_evaluate_property (prop, frame, addr_stack, &value))
+ if (prop != nullptr
+ && dwarf2_evaluate_property (prop, frame, addr_stack, &value))
{
prop->set_const_val (value);
rank = value;