diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2020-05-06 20:55:07 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2020-05-06 20:55:07 +0300 |
commit | 1b79c13f8aa4c93ea727b1d42b30f3838faeaedf (patch) | |
tree | 97ee08fd0c99777fb1e9a78ca8a3a6bd3e017e94 /awkgram.c | |
parent | 2a1b7457e8c878650352cf4925872c59d07a5fa2 (diff) | |
download | egawk-1b79c13f8aa4c93ea727b1d42b30f3838faeaedf.tar.gz egawk-1b79c13f8aa4c93ea727b1d42b30f3838faeaedf.tar.bz2 egawk-1b79c13f8aa4c93ea727b1d42b30f3838faeaedf.zip |
Add lint check for string + string.
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -8016,7 +8016,7 @@ dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2) static INSTRUCTION * mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op) { - INSTRUCTION *ip1,*ip2; + INSTRUCTION *ip1,*ip2, *lint_plus; AWKNUM res; ip2 = s2->nexti; @@ -8095,6 +8095,8 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op) op->opcode = Op_mod_i; break; case Op_plus: + if (do_lint) + goto regular; op->opcode = Op_plus_i; break; case Op_minus: @@ -8117,6 +8119,10 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op) regular: /* append lists s1, s2 and add `op' bytecode */ (void) list_merge(s1, s2); + if (do_lint && op->opcode == Op_plus) { + lint_plus = instruction(Op_lint_plus); + (void) list_append(s1, lint_plus); + } return list_append(s1, op); } |