mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Use a vector in objc_msgcall_operation::evaluate
This changes objc_msgcall_operation::evaluate to use a std::vector rather than XALLOCAVEC. alloca is bad and should generally be avoided; and anyway there's no justification for it here.
This commit is contained in:
19
gdb/eval.c
19
gdb/eval.c
@@ -2238,17 +2238,16 @@ objc_msgcall_operation::evaluate (struct type *expect_type,
|
||||
sub_no_side = EVAL_AVOID_SIDE_EFFECTS;
|
||||
else
|
||||
sub_no_side = noside;
|
||||
std::vector<operation_up> &args = std::get<2> (m_storage);
|
||||
value **argvec = XALLOCAVEC (struct value *, args.size () + 2);
|
||||
argvec[0] = nullptr;
|
||||
argvec[1] = nullptr;
|
||||
for (int i = 0; i < args.size (); ++i)
|
||||
argvec[i + 2] = args[i]->evaluate_with_coercion (exp, sub_no_side);
|
||||
|
||||
return eval_op_objc_msgcall (expect_type, exp, noside, std::
|
||||
get<0> (m_storage), target,
|
||||
gdb::make_array_view (argvec,
|
||||
args.size () + 2));
|
||||
std::vector<operation_up> &args = std::get<2> (m_storage);
|
||||
std::vector<value *> argvec;
|
||||
argvec.push_back (nullptr);
|
||||
argvec.push_back (nullptr);
|
||||
for (const operation_up &iter : args)
|
||||
argvec.push_back (iter->evaluate_with_coercion (exp, sub_no_side));
|
||||
|
||||
return eval_op_objc_msgcall (expect_type, exp, noside,
|
||||
std::get<0> (m_storage), target, argvec);
|
||||
}
|
||||
|
||||
value *
|
||||
|
||||
Reference in New Issue
Block a user