diff --git generic/tclUtil.c generic/tclUtil.c
index 8e9b4c0e4..19ac44adc 100644
--- generic/tclUtil.c
+++ generic/tclUtil.c
@@ -1598,7 +1598,9 @@ Tcl_Merge(
 	    Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
 	}
     }
-    if (bytesNeeded > INT_MAX - argc + 1) {
+    if (argc < 0) {
+	Tcl_Panic("Tcl_Merge called with negative argc (%d)", argc);
+    } else if (bytesNeeded > INT_MAX - argc + 1) {
 	Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
     }
     bytesNeeded += argc;
