]> git.kaiwu.me - njs.git/commitdiff
Fixed building by GCC with -O3.
authorVadim Zhestikov <v.zhestikov@f5.com>
Wed, 23 Aug 2023 17:09:22 +0000 (10:09 -0700)
committerVadim Zhestikov <v.zhestikov@f5.com>
Wed, 23 Aug 2023 17:09:22 +0000 (10:09 -0700)
src/njs_array.c

index 09a45339d9f49dd887f3397ebde74c16e4fe1a84..7a57c8865bc934eb3f04426a0351048e24b4fc9c 100644 (file)
@@ -2952,6 +2952,9 @@ njs_array_prototype_sort(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
         return ret;
     }
 
+    /* Satisfy gcc -O3 */
+    nslots = 0;
+
     slots = njs_sort_indexed_properties(vm, this, length, compare, 1, &nslots,
                                         &nunds);
     if (njs_slow_path(slots == NULL)) {