diff options
Diffstat (limited to 'awkgram.y')
-rw-r--r-- | awkgram.y | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1755,7 +1755,12 @@ non_post_simp_exp } } | '(' exp r_paren - { $$ = $2; } + { + if (do_pretty_print) + $$ = list_append($2, bcalloc(Op_parens, 1, sourceline)); + else + $$ = $2; + } | LEX_BUILTIN '(' opt_fcall_expression_list r_paren { $$ = snode($3, $1); @@ -2410,8 +2415,7 @@ yyerror(const char *m, ...) count = strlen(mesg) + 1; if (lexptr != NULL) count += (lexeme - thisline) + 2; - emalloc(buf, char *, count+1, "yyerror"); - memset(buf, 0, count+1); + ezalloc(buf, char *, count+1, "yyerror"); bp = buf; @@ -2630,8 +2634,7 @@ do_add_srcfile(enum srctype stype, char *src, char *path, SRCFILE *thisfile) { SRCFILE *s; - emalloc(s, SRCFILE *, sizeof(SRCFILE), "do_add_srcfile"); - memset(s, 0, sizeof(SRCFILE)); + ezalloc(s, SRCFILE *, sizeof(SRCFILE), "do_add_srcfile"); s->src = estrdup(src, strlen(src)); s->fullpath = path; s->stype = stype; @@ -4910,8 +4913,7 @@ func_use(const char *name, enum defref how) /* not in the table, fall through to allocate a new one */ - emalloc(fp, struct fdesc *, sizeof(struct fdesc), "func_use"); - memset(fp, '\0', sizeof(struct fdesc)); + ezalloc(fp, struct fdesc *, sizeof(struct fdesc), "func_use"); emalloc(fp->name, char *, len + 1, "func_use"); strcpy(fp->name, name); fp->next = ftable[ind]; @@ -5929,7 +5931,7 @@ add_lint(INSTRUCTION *list, LINTTYPE linttype) // closest to the opcode if that opcode doesn't have one if (ip->source_line != 0) line = ip->source_line; - } + } if (do_lint) { /* compile-time warning */ if (isnoeffect(ip->opcode)) { |