/* create a new value */
val = newValue ();
- val->type = copyLinkChain (lval->type);
+ val->type = copyLinkChain (getSize(rval->type) > getSize(lval->type) ?
+ rval->type : lval->type);
val->etype = getSpec (val->type);
switch (op)
int
getNelements (sym_link * type, initList * ilist)
{
- sym_link *etype = getSpec (type);
int i;
if (!ilist)
return 0;
- while (ilist->type == INIT_DEEP)
+ if (ilist->type == INIT_DEEP)
ilist = ilist->init.deep;
/* if type is a character array and there is only one
(string) initialiser then get the length of the string */
- if (IS_ARRAY (type) && IS_CHAR (etype) && !ilist->next)
+ if (IS_ARRAY (type) && IS_CHAR (type->next) && !ilist->next)
{
ast *iast = ilist->init.node;
value *v = (iast->type == EX_VALUE ? iast->opval.val : NULL);
i++;
ilist = ilist->next;
}
-
return i;
}