int give_prompt;
}
:
+ { errorgiven = 0; }
[ %persistent command_line(&com)
[ '\n' { give_prompt = 1; }
| %default ';' { give_prompt = 0; }
| FIND qualified_name(p){ *p = mknode(OP_FIND, *p); }
| WHICH qualified_name(p){ *p = mknode(OP_WHICH, *p); }
| able_command(p)
-| '!' { shellescape(); }
+| '!' { shellescape();
+ errorgiven = 1; /* to prevent execution of lastcomm */
+ }
|
]
;
/* another N_SO follows ... */
break;
}
+ clean_tp_tab();
while (CurrentScope != PervasiveScope) {
close_scope();
}
open_scope(sym, 0);
sym->sy_file->f_scope = CurrentScope;
FileScope = CurrentScope;
- clean_tp_tab();
/* fall through */
case N_SOL:
if (! line_file) line_file = n;
malloc_succeeded(*pbuf);
}
if ((*ptp)->ty_class == T_SUBRANGE) *ptp = (*ptp)->ty_base;
- switch((*ptp)->ty_class) {
+ if (tp && *ptp) switch((*ptp)->ty_class) {
case T_INTEGER:
case T_UNSIGNED:
case T_POINTER:
}
*psize = 0;
}
+ else {
+ if ((*ptp)->ty_class == T_CROSS) {
+ *ptp = (*ptp)->ty_cross;
+ if (! *ptp) *ptp = void_type;
+ }
+ }
return retval;
}
if (! retval) {
*psize = 0;
}
+ else {
+ if ((*ptp)->ty_class == T_CROSS) {
+ *ptp = (*ptp)->ty_cross;
+ if (! *ptp) {
+ *ptp = void_type;
+ print_node(p, 0);
+ fputs(" designator has unknown type\n", db_out);
+ retval = 0;
+ *psize = 0;
+ }
+ }
+ }
return retval;
}
#include <alloc.h>
#include <assert.h>
+#include "idf.h"
#include "type.h"
#include "sizes.h"
#include "symbol.h"
*/
static struct tp_index {
unsigned len;
- p_type *row;
+ p_type **row;
} *list_row;
static unsigned list_len;
}
p = &list_row[type_index[0]];
while (type_index[1] >= p->len) {
+ int indx = p->len/NINCR;
+ p->len += NINCR;
if (p->len) {
- p->row = (p_type *) Realloc((char *) p->row,
- (p->len += NINCR) * sizeof(p_type));
+ p->row = (p_type **) Realloc((char *) p->row,
+ (unsigned) (indx + 1) * sizeof(p_type *));
}
- else p->row = (p_type *) Malloc((p->len = NINCR) * sizeof(p_type));
- for (i = NINCR; i > 0; i--) {
- p->row[p->len - i] = 0;
+ else p->row = (p_type **) Malloc(sizeof(p_type *));
+ p->row[indx] = (p_type *) Malloc(NINCR * sizeof(p_type));
+ for (i = NINCR-1; i >= 0; i--) {
+ p->row[indx][i] = 0;
}
}
- return &(p->row[type_index[1]]);
+ return &(p->row[type_index[1]/NINCR][type_index[1]%NINCR]);
}
clean_tp_tab()
register int j = list_row[i].len;
if (j) {
while (--j > 0) {
- p_type p = list_row[i].row[j];
+ p_type p = list_row[i].row[j/NINCR][j%NINCR];
if (p && p->ty_class == 0) {
- error("incomplete type (%d,%d) 0x%x", i, j, &list_row[i].row[j]);
+ error("%s: incomplete type (%d,%d)",
+ listfile->sy_idf->id_text,
+ i,
+ j);
}
}
+ j = list_row[i].len;
+ while (j > 0) {
+ free((char *) list_row[i].row[j/NINCR-1]);
+ j -= NINCR;
+ }
free((char *) list_row[i].row);
}
}