This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] GNU vector binop support


On Tue, 10 Aug 2010 14:01:39 +0200, Ken Werner wrote:
> +struct value *
> +vector_binop (struct value *val1, struct value *val2, enum exp_opcode op)
> +{
[...]
> +  elsize =  TYPE_LENGTH (eltype1);
> +  n = TYPE_LENGTH (type1) / elsize;
> +  val = allocate_value (type1);
> +
> +  mark = value_mark ();
> +  for (i = 0; i < n; i++)
> +    {
> +      tmp = value_binop (value_subscript (val1, i),
> +			 value_subscript (val2, i), op);

There is no check whether VAL1 and VAL2 are vectors of the same length (such
as the number of elements, even if the element size is the same).


Thanks,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]