/* Evaluate expressions for GDB.
- Copyright (C) 1986-2022 Free Software Foundation, Inc.
+ Copyright (C) 1986-2023 Free Software Foundation, Inc.
This file is part of GDB.
/* See expression.h. */
+bool
+expression::uses_objfile (struct objfile *objfile) const
+{
+ gdb_assert (objfile->separate_debug_objfile_backlink == nullptr);
+ return op->uses_objfile (objfile);
+}
+
+/* See expression.h. */
+
struct value *
expression::evaluate (struct type *expect_type, enum noside noside)
{
struct type *type1;
*arg1 = coerce_ref (*arg1);
- type1 = check_typedef (value_type (*arg1));
+ type1 = check_typedef ((*arg1)->type ());
if (is_integral_type (type1))
{
{
struct type *builtin_int = builtin_type (gdbarch)->builtin_int;
- if (TYPE_LENGTH (type1) < TYPE_LENGTH (builtin_int))
+ if (type1->length () < builtin_int->length ())
*arg1 = value_cast (builtin_int, *arg1);
}
break;
*arg1 = coerce_ref (*arg1);
*arg2 = coerce_ref (*arg2);
- type1 = check_typedef (value_type (*arg1));
- type2 = check_typedef (value_type (*arg2));
+ type1 = check_typedef ((*arg1)->type ());
+ type2 = check_typedef ((*arg2)->type ());
if ((type1->code () != TYPE_CODE_FLT
&& type1->code () != TYPE_CODE_DECFLOAT
version 6.7 for backward compatibility.
If either arg was long double, make sure that value is also long
double. Otherwise use double. */
- if (TYPE_LENGTH (type1) * 8 > gdbarch_double_bit (gdbarch)
- || TYPE_LENGTH (type2) * 8 > gdbarch_double_bit (gdbarch))
+ if (type1->length () * 8 > gdbarch_double_bit (gdbarch)
+ || type2->length () * 8 > gdbarch_double_bit (gdbarch))
promoted_type = builtin_type (gdbarch)->builtin_long_double;
else
promoted_type = builtin_type (gdbarch)->builtin_double;
/* FIXME: Also mixed integral/booleans, with result an integer. */
{
const struct builtin_type *builtin = builtin_type (gdbarch);
- unsigned int promoted_len1 = TYPE_LENGTH (type1);
- unsigned int promoted_len2 = TYPE_LENGTH (type2);
+ unsigned int promoted_len1 = type1->length ();
+ unsigned int promoted_len2 = type2->length ();
int is_unsigned1 = type1->is_unsigned ();
int is_unsigned2 = type2->is_unsigned ();
unsigned int result_len;
/* Determine type length and signedness after promotion for
both operands. */
- if (promoted_len1 < TYPE_LENGTH (builtin->builtin_int))
+ if (promoted_len1 < builtin->builtin_int->length ())
{
is_unsigned1 = 0;
- promoted_len1 = TYPE_LENGTH (builtin->builtin_int);
+ promoted_len1 = builtin->builtin_int->length ();
}
- if (promoted_len2 < TYPE_LENGTH (builtin->builtin_int))
+ if (promoted_len2 < builtin->builtin_int->length ())
{
is_unsigned2 = 0;
- promoted_len2 = TYPE_LENGTH (builtin->builtin_int);
+ promoted_len2 = builtin->builtin_int->length ();
}
if (promoted_len1 > promoted_len2)
case language_cplus:
case language_asm:
case language_objc:
- if (result_len <= TYPE_LENGTH (builtin->builtin_int))
+ if (result_len <= builtin->builtin_int->length ())
{
promoted_type = (unsigned_operation
? builtin->builtin_unsigned_int
: builtin->builtin_int);
}
- else if (result_len <= TYPE_LENGTH (builtin->builtin_long))
+ else if (result_len <= builtin->builtin_long->length ())
{
promoted_type = (unsigned_operation
? builtin->builtin_unsigned_long
}
break;
case language_opencl:
- if (result_len <= TYPE_LENGTH (lookup_signed_typename
- (language, "int")))
+ if (result_len
+ <= lookup_signed_typename (language, "int")->length())
{
promoted_type =
(unsigned_operation
? lookup_unsigned_typename (language, "int")
: lookup_signed_typename (language, "int"));
}
- else if (result_len <= TYPE_LENGTH (lookup_signed_typename
- (language, "long")))
+ else if (result_len
+ <= lookup_signed_typename (language, "long")->length())
{
promoted_type =
(unsigned_operation
struct type *type = &m_type;
TYPE_MAIN_TYPE (type) = &m_main_type;
- TYPE_LENGTH (type) = 1;
+ type->set_length (1);
type->set_code (TYPE_CODE_METHOD);
TYPE_CHAIN (type) = type;
type->set_instance_flags (flags);
call an error. This can happen if somebody tries to turn
a variable into a function call. */
- type *ftype = value_type (callee);
+ type *ftype = callee->type ();
if (ftype->code () == TYPE_CODE_INTERNAL_FUNCTION)
{
error (_("Expression of type other than "
"\"Function returning ...\" used as function"));
}
- switch (value_type (callee)->code ())
+ switch (callee->type ()->code ())
{
case TYPE_CODE_INTERNAL_FUNCTION:
return call_internal_function (exp->gdbarch, exp->language_defn,
std::vector<value *> vals (args.size ());
value *callee = evaluate_with_coercion (exp, noside);
- struct type *type = value_type (callee);
+ struct type *type = callee->type ();
if (type->code () == TYPE_CODE_PTR)
type = type->target_type ();
for (int i = 0; i < args.size (); ++i)
value *rhs = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
value *callee;
- type *a1_type = check_typedef (value_type (rhs));
+ type *a1_type = check_typedef (rhs->type ());
if (a1_type->code () == TYPE_CODE_METHODPTR)
{
if (noside == EVAL_AVOID_SIDE_EFFECTS)
/* value_struct_elt updates temp with the correct value of the
``this'' pointer if necessary, so modify it to reflect any
``this'' changes. */
- vals[0] = value_from_longest (lookup_pointer_type (value_type (temp)),
+ vals[0] = value_from_longest (lookup_pointer_type (temp->type ()),
value_address (temp)
+ value_embedded_offset (temp));
}
value *lhs = std::get<0> (m_storage)->evaluate (nullptr, exp,
EVAL_AVOID_SIDE_EFFECTS);
- struct type *type = value_type (lhs);
+ struct type *type = lhs->type ();
for (;;)
{
type = check_typedef (type);
error (_("Symbol \"%s\" does not have any specific entry value"),
sym->print_name ());
- struct frame_info *frame = get_selected_frame (NULL);
+ frame_info_ptr frame = get_selected_frame (NULL);
return SYMBOL_COMPUTED_OPS (sym)->read_variable_at_entry (sym, frame);
}
value *val = evaluate_var_msym_value (noside, msymbol.objfile,
msymbol.minsym);
- struct type *type = value_type (val);
+ struct type *type = val->type ();
if (type->code () == TYPE_CODE_ERROR
&& (noside != EVAL_AVOID_SIDE_EFFECTS || !outermost_p))
error_unknown_type (msymbol.minsym->print_name ());
struct value *arg3 = value_struct_elt (&arg1, {}, string,
NULL, "structure");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- arg3 = value_zero (value_type (arg3), VALUE_LVAL (arg3));
+ arg3 = value_zero (arg3->type (), VALUE_LVAL (arg3));
return arg3;
}
with rtti type in order to continue on with successful
lookup of member / method only available in the rtti type. */
{
- struct type *arg_type = value_type (arg1);
+ struct type *arg_type = arg1->type ();
struct type *real_type;
int full, using_enc;
LONGEST top;
struct value *arg3 = value_struct_elt (&arg1, {}, string,
NULL, "structure pointer");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- arg3 = value_zero (value_type (arg3), VALUE_LVAL (arg3));
+ arg3 = value_zero (arg3->type (), VALUE_LVAL (arg3));
return arg3;
}
long mem_offset;
struct value *arg3;
- struct type *type = check_typedef (value_type (arg2));
+ struct type *type = check_typedef (arg2->type ());
switch (type->code ())
{
case TYPE_CODE_METHODPTR:
else
{
arg2 = cplus_method_ptr_to_value (&arg1, arg2);
- gdb_assert (value_type (arg2)->code () == TYPE_CODE_PTR);
+ gdb_assert (arg2->type ()->code () == TYPE_CODE_PTR);
return value_ind (arg2);
}
case TYPE_CODE_MEMBERPTR:
/* Now, convert these values to an address. */
+ if (check_typedef (arg1->type ())->code () != TYPE_CODE_PTR)
+ arg1 = value_addr (arg1);
arg1 = value_cast_pointers (lookup_pointer_type (TYPE_SELF_TYPE (type)),
arg1, 1);
{
if (binop_user_defined_p (BINOP_ADD, arg1, arg2))
return value_x_binop (arg1, arg2, BINOP_ADD, OP_NULL, noside);
- else if (ptrmath_type_p (exp->language_defn, value_type (arg1))
- && is_integral_or_integral_reference (value_type (arg2)))
+ else if (ptrmath_type_p (exp->language_defn, arg1->type ())
+ && is_integral_or_integral_reference (arg2->type ()))
return value_ptradd (arg1, value_as_long (arg2));
- else if (ptrmath_type_p (exp->language_defn, value_type (arg2))
- && is_integral_or_integral_reference (value_type (arg1)))
+ else if (ptrmath_type_p (exp->language_defn, arg2->type ())
+ && is_integral_or_integral_reference (arg1->type ()))
return value_ptradd (arg2, value_as_long (arg1));
else
{
{
if (binop_user_defined_p (BINOP_SUB, arg1, arg2))
return value_x_binop (arg1, arg2, BINOP_SUB, OP_NULL, noside);
- else if (ptrmath_type_p (exp->language_defn, value_type (arg1))
- && ptrmath_type_p (exp->language_defn, value_type (arg2)))
+ else if (ptrmath_type_p (exp->language_defn, arg1->type ())
+ && ptrmath_type_p (exp->language_defn, arg2->type ()))
{
/* FIXME -- should be ptrdiff_t */
struct type *type = builtin_type (exp->gdbarch)->builtin_long;
return value_from_longest (type, value_ptrdiff (arg1, arg2));
}
- else if (ptrmath_type_p (exp->language_defn, value_type (arg1))
- && is_integral_or_integral_reference (value_type (arg2)))
+ else if (ptrmath_type_p (exp->language_defn, arg1->type ())
+ && is_integral_or_integral_reference (arg2->type ()))
return value_ptradd (arg1, - value_as_long (arg2));
else
{
{
struct value *v_one;
- v_one = value_one (value_type (arg2));
+ v_one = value_one (arg2->type ());
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &v_one);
return value_binop (arg1, v_one, op);
}
/* For shift and integer exponentiation operations,
only promote the first argument. */
if ((op == BINOP_LSH || op == BINOP_RSH || op == BINOP_EXP)
- && is_integral_type (value_type (arg2)))
+ && is_integral_type (arg2->type ()))
unop_promote (exp->language_defn, exp->gdbarch, &arg1);
else
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
then report this as an error. */
arg1 = coerce_ref (arg1);
- struct type *type = check_typedef (value_type (arg1));
+ struct type *type = check_typedef (arg1->type ());
if (type->code () != TYPE_CODE_ARRAY
&& type->code () != TYPE_CODE_PTR)
{
enum noside noside, enum exp_opcode op,
struct value *arg1, struct value *arg2)
{
- struct type *type = check_typedef (value_type (arg2));
+ struct type *type = check_typedef (arg2->type ());
if (type->code () != TYPE_CODE_INT
&& type->code () != TYPE_CODE_ENUM)
error (_("Non-integral right operand for \"@\" operator."));
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
- return allocate_repeat_value (value_type (arg1),
+ return allocate_repeat_value (arg1->type (),
longest_to_int (value_as_long (arg2)));
}
else
enum noside noside,
struct value *arg1)
{
- struct type *type = check_typedef (value_type (arg1));
+ struct type *type = check_typedef (arg1->type ());
if (type->code () == TYPE_CODE_METHODPTR
|| type->code () == TYPE_CODE_MEMBERPTR)
error (_("Attempt to dereference pointer "
return value_x_unop (arg1, UNOP_IND, noside);
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
- type = check_typedef (value_type (arg1));
+ type = check_typedef (arg1->type ());
/* If the type pointed to is dynamic then in order to resolve the
dynamic properties we must actually dereference the pointer.
enum noside noside,
struct value *arg1)
{
- struct type *type = value_type (arg1);
+ struct type *type = arg1->type ();
/* FIXME: This should be size_t. */
struct type *size_type = builtin_type (exp->gdbarch)->builtin_int;
ULONGEST align = type_align (type);
else
{
struct value *arg2;
- if (ptrmath_type_p (exp->language_defn, value_type (arg1)))
+ if (ptrmath_type_p (exp->language_defn, arg1->type ()))
arg2 = value_ptradd (arg1, 1);
else
{
struct value *tmp = arg1;
- arg2 = value_one (value_type (arg1));
+ arg2 = value_one (arg1->type ());
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_ADD);
}
else
{
struct value *arg2;
- if (ptrmath_type_p (exp->language_defn, value_type (arg1)))
+ if (ptrmath_type_p (exp->language_defn, arg1->type ()))
arg2 = value_ptradd (arg1, -1);
else
{
struct value *tmp = arg1;
- arg2 = value_one (value_type (arg1));
+ arg2 = value_one (arg1->type ());
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_SUB);
}
struct value *arg3 = value_non_lval (arg1);
struct value *arg2;
- if (ptrmath_type_p (exp->language_defn, value_type (arg1)))
+ if (ptrmath_type_p (exp->language_defn, arg1->type ()))
arg2 = value_ptradd (arg1, 1);
else
{
struct value *tmp = arg1;
- arg2 = value_one (value_type (arg1));
+ arg2 = value_one (arg1->type ());
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_ADD);
}
struct value *arg3 = value_non_lval (arg1);
struct value *arg2;
- if (ptrmath_type_p (exp->language_defn, value_type (arg1)))
+ if (ptrmath_type_p (exp->language_defn, arg1->type ()))
arg2 = value_ptradd (arg1, -1);
else
{
struct value *tmp = arg1;
- arg2 = value_one (value_type (arg1));
+ arg2 = value_one (arg1->type ());
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_SUB);
}
if (binop_user_defined_p (op, arg1, arg2))
return value_x_binop (arg1, arg2, BINOP_ASSIGN_MODIFY, op, noside);
else if (op == BINOP_ADD && ptrmath_type_p (exp->language_defn,
- value_type (arg1))
- && is_integral_type (value_type (arg2)))
+ arg1->type ())
+ && is_integral_type (arg2->type ()))
arg2 = value_ptradd (arg1, value_as_long (arg2));
else if (op == BINOP_SUB && ptrmath_type_p (exp->language_defn,
- value_type (arg1))
- && is_integral_type (value_type (arg2)))
+ arg1->type ())
+ && is_integral_type (arg2->type ()))
arg2 = value_ptradd (arg1, - value_as_long (arg2));
else
{
/* For shift and integer exponentiation operations,
only promote the first argument. */
if ((op == BINOP_LSH || op == BINOP_RSH || op == BINOP_EXP)
- && is_integral_type (value_type (arg2)))
+ && is_integral_type (arg2->type ()))
unop_promote (exp->language_defn, exp->gdbarch, &tmp);
else
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
if (method)
{
- if (value_type (method)->code () != TYPE_CODE_FUNC)
+ if (method->type ()->code () != TYPE_CODE_FUNC)
error (_("method address has symbol information "
"with non-function type; skipping"));
function descriptors. */
if (struct_return)
called_method
- = value_from_pointer (lookup_pointer_type (value_type (method)),
+ = value_from_pointer (lookup_pointer_type (method->type ()),
value_as_address (msg_send_stret));
else
called_method
- = value_from_pointer (lookup_pointer_type (value_type (method)),
+ = value_from_pointer (lookup_pointer_type (method->type ()),
value_as_address (msg_send));
}
else
it's opinion (ie. through "whatis"), it won't offer
it. */
- struct type *callee_type = value_type (called_method);
+ struct type *callee_type = called_method->type ();
if (callee_type && callee_type->code () == TYPE_CODE_PTR)
callee_type = callee_type->target_type ();
if (gnu_runtime && (method != NULL))
{
/* Function objc_msg_lookup returns a pointer. */
- struct type *tem_type = value_type (called_method);
+ struct type *tem_type = called_method->type ();
tem_type = lookup_pointer_type (lookup_function_type (tem_type));
- deprecated_set_value_type (called_method, tem_type);
+ called_method->deprecated_set_type (tem_type);
called_method = call_function_by_hand (called_method, NULL, args);
}
else
{
arg1 = coerce_ref (arg1);
- struct type *type = check_typedef (value_type (arg1));
+ struct type *type = check_typedef (arg1->type ());
switch (type->code ())
{
enum noside noside, int nargs)
{
const std::vector<operation_up> &in_args = std::get<2> (m_storage);
- struct type *struct_type = check_typedef (value_type (struct_val));
+ struct type *struct_type = check_typedef (struct_val->type ());
struct type *field_type;
int fieldno = -1;
/* Now actually set the field in struct_val. */
/* Assign val to field fieldno. */
- if (value_type (val) != field_type)
+ if (val->type () != field_type)
val = value_cast (field_type, val);
bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
value_as_long (val), bitpos % 8, bitsize);
else
memcpy (addr, value_contents (val).data (),
- TYPE_LENGTH (value_type (val)));
+ val->type ()->length ());
}
return struct_val;
{
struct value *rec = allocate_value (expect_type);
- memset (value_contents_raw (rec).data (), '\0', TYPE_LENGTH (type));
+ memset (value_contents_raw (rec).data (), '\0', type->length ());
return evaluate_struct_tuple (rec, exp, noside, nargs);
}
struct type *range_type = type->index_type ();
struct type *element_type = type->target_type ();
struct value *array = allocate_value (expect_type);
- int element_size = TYPE_LENGTH (check_typedef (element_type));
+ int element_size = check_typedef (element_type)->length ();
LONGEST low_bound, high_bound, index;
if (!get_discrete_bounds (range_type, &low_bound, &high_bound))
{
low_bound = 0;
- high_bound = (TYPE_LENGTH (type) / element_size) - 1;
+ high_bound = (type->length () / element_size) - 1;
}
index = low_bound;
- memset (value_contents_raw (array).data (), 0, TYPE_LENGTH (expect_type));
+ memset (value_contents_raw (array).data (), 0, expect_type->length ());
for (tem = nargs; --nargs >= 0;)
{
struct value *element;
element = in_args[index - low_bound]->evaluate (element_type,
exp, noside);
- if (value_type (element) != element_type)
+ if (element->type () != element_type)
element = value_cast (element_type, element);
if (index > high_bound)
/* To avoid memory corruption. */
if (!get_discrete_bounds (element_type, &low_bound, &high_bound))
error (_("(power)set type with unknown size"));
- memset (valaddr, '\0', TYPE_LENGTH (type));
+ memset (valaddr, '\0', type->length ());
int idx = 0;
for (tem = 0; tem < nargs; tem++)
{
struct value *elem_val;
elem_val = in_args[idx++]->evaluate (element_type, exp, noside);
- range_low_type = range_high_type = value_type (elem_val);
+ range_low_type = range_high_type = elem_val->type ();
range_low = range_high = value_as_long (elem_val);
/* Check types of elements to avoid mixture of elements from
value *old_value = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
struct type *type = get_type ();
- if (TYPE_LENGTH (type) > TYPE_LENGTH (value_type (old_value)))
+ if (type->length () > old_value->type ()->length ())
error (_("length type is larger than the value type"));
struct value *result = allocate_value (type);
- value_contents_copy (result, 0, old_value, 0, TYPE_LENGTH (type));
+ value_contents_copy (result, 0, old_value, 0, type->length ());
return result;
}
{
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
- struct type *type = check_typedef (value_type (x));
+ struct type *type = check_typedef (x->type ());
if (TYPE_IS_REFERENCE (type))
return value_zero (lookup_pointer_type (type->target_type ()),
not_lval);
else if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
- return value_zero (lookup_pointer_type (value_type (x)),
+ return value_zero (lookup_pointer_type (x->type ()),
not_lval);
else
error (_("Attempt to take address of "
value *val = evaluate_var_msym_value (noside, b.objfile, b.minsym);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
- struct type *type = lookup_pointer_type (value_type (val));
+ struct type *type = lookup_pointer_type (val->type ());
return value_zero (type, not_lval);
}
else
{
value *typeval = std::get<0> (m_storage)->evaluate (nullptr, exp,
EVAL_AVOID_SIDE_EFFECTS);
- struct type *type = value_type (typeval);
+ struct type *type = typeval->type ();
return value_cast (lookup_pointer_type (type),
std::get<1> (m_storage)->evaluate (nullptr, exp, noside));
}
if (exp->language_defn->la_language == language_cplus
&& (TYPE_IS_REFERENCE (type)))
type = check_typedef (type->target_type ());
- return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type));
+ return value_from_longest (size_type, (LONGEST) type->length ());
}
namespace expr
operation::evaluate_for_sizeof (struct expression *exp, enum noside noside)
{
value *val = evaluate (nullptr, exp, EVAL_AVOID_SIDE_EFFECTS);
- return evaluate_subexp_for_sizeof_base (exp, value_type (val));
+ return evaluate_subexp_for_sizeof_base (exp, val->type ());
}
value *
const bound_minimal_symbol &b = std::get<0> (m_storage);
value *mval = evaluate_var_msym_value (noside, b.objfile, b.minsym);
- struct type *type = value_type (mval);
+ struct type *type = mval->type ();
if (type->code () == TYPE_CODE_ERROR)
error_unknown_type (b.minsym->print_name ());
/* FIXME: This should be size_t. */
struct type *size_type = builtin_type (exp->gdbarch)->builtin_int;
- return value_from_longest (size_type, TYPE_LENGTH (type));
+ return value_from_longest (size_type, type->length ());
}
value *
{
value *val = std::get<0> (m_storage)->evaluate (nullptr, exp,
EVAL_AVOID_SIDE_EFFECTS);
- struct type *type = check_typedef (value_type (val));
+ struct type *type = check_typedef (val->type ());
if (type->code () == TYPE_CODE_ARRAY)
{
type = check_typedef (type->target_type ());
struct type *size_type
= builtin_type (exp->gdbarch)->builtin_int;
return value_from_longest
- (size_type, (LONGEST) TYPE_LENGTH (value_type (val)));
+ (size_type, (LONGEST) val->type ()->length ());
}
}
}
{
value *val = std::get<0> (m_storage)->evaluate (nullptr, exp,
EVAL_AVOID_SIDE_EFFECTS);
- struct type *type = check_typedef (value_type (val));
+ struct type *type = check_typedef (val->type ());
if (!type->is_pointer_or_reference ()
&& type->code () != TYPE_CODE_ARRAY)
error (_("Attempt to take contents of a non-pointer value."));
type = type->target_type ();
if (is_dynamic_type (type))
- type = value_type (value_ind (val));
+ type = value_ind (val)->type ();
/* FIXME: This should be size_t. */
struct type *size_type = builtin_type (exp->gdbarch)->builtin_int;
- return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type));
+ return value_from_longest (size_type, (LONGEST) type->length ());
}
value *
{
value *typeval = std::get<0> (m_storage)->evaluate (nullptr, exp,
EVAL_AVOID_SIDE_EFFECTS);
- return evaluate_subexp_for_sizeof_base (exp, value_type (typeval));
+ return evaluate_subexp_for_sizeof_base (exp, typeval->type ());
}
value *
if (is_dynamic_type (type))
{
value *val = evaluate (nullptr, exp, EVAL_NORMAL);
- type = value_type (val);
+ type = val->type ();
if (type->code () == TYPE_CODE_ARRAY)
{
/* FIXME: This should be size_t. */