]> git.kaiwu.me - njs.git/commitdiff
Suppressed spurious compilation warning with gcc-7 and older.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 24 May 2021 12:33:36 +0000 (12:33 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 24 May 2021 12:33:36 +0000 (12:33 +0000)
src/njs_regexp.c:1335:19: error: ‘pos’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
    pos = njs_string_offset(s.start, s.start + s.size, pos) - s.start;

src/njs_regexp.c

index 00a73e774974196204e65ad62c4facc64f9e99c4..c96a53ac8daff8949efeefa7f55a3e21b1481cd7 100644 (file)
@@ -1301,6 +1301,7 @@ njs_regexp_prototype_symbol_replace(njs_vm_t *vm, njs_value_t *args,
     }
 
     i = 0;
+    pos = 0;
     next_pos = 0;
 
     while (i < results.items) {