Branch: Tag:

2019-03-19

2019-03-19 13:47:58 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Optimizer [array]: Keep UNDEFINED values.

In some cases the array optimizer replaced UNDEFINED values
with zeroes.

22:   #include "security.h"   #include "stuff.h"    - RCSID("$Id: array.c,v 1.54 1999/09/16 23:56:08 hubbe Exp $"); + RCSID("$Id$");      struct array empty_array=   {
1385:    if(a->type_field == BIT_INT)    {    for(e=0; e<a->size; e++) -  if(ITEM(a)[e].u.integer != 0) +  if(ITEM(a)[e].u.integer || SUBTYPEOF(ITEM(a)[e]))    break;    if(e == a->size)    {
1399:    {    case BIT_INT:    for(e=1; e<a->size; e++) -  if(ITEM(a)[e].u.integer != ITEM(a)[0].u.integer) +  if((ITEM(a)[e].u.integer != ITEM(a)[0].u.integer) || +  (SUBTYPEOF(ITEM(a)[e]) != SUBTYPEOF(ITEM(a)[0]))) {    break; -  if(e==a->size && ITEM(a)[0].u.integer==0) +  } +  if(e==a->size && ITEM(a)[0].u.integer==0 && !SUBTYPEOF(ITEM(a)[0]))    return mkefuncallnode("allocate",mkintnode(a->size));    break;