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. --- interpret.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'interpret.h') diff --git a/interpret.h b/interpret.h index 80ef4689..6137e8e0 100644 --- a/interpret.h +++ b/interpret.h @@ -412,6 +412,15 @@ uninitialized_scalar: } break; + case Op_lint_plus: + // no need to check do_lint, this opcode won't + // be generated if that's not true + t1 = TOP(); + t2 = PEEK(1); + if ((t1->flags & STRING) != 0 && (t2->flags & STRING) != 0) + lintwarn(_("operator `+' used on two string values")); + break; + case Op_K_break: case Op_K_continue: case Op_jmp: -- cgit v1.2.3