From 1b79c13f8aa4c93ea727b1d42b30f3838faeaedf Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 6 May 2020 20:55:07 +0300 Subject: Add lint check for string + string. --- awkgram.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index fa62ee6f..0aa364a4 100644 --- a/awkgram.c +++ b/awkgram.c @@ -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); } -- cgit v1.2.3