changeset 2565:53dee29bb431

Fixed gcc compilation with O3 optimization level.
author Dmitry Volyntsev <xeioex@nginx.com>
date Mon, 02 Jun 2025 19:08:27 -0700
parents 63438e4b702b
children c57fd8226c8c
files src/qjs.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/qjs.c	Tue Jun 03 22:37:32 2025 -0700
+++ b/src/qjs.c	Mon Jun 02 19:08:27 2025 -0700
@@ -911,6 +911,11 @@
         goto string;
     }
 
+    /* GCC complains about uninitialized variables. */
+
+    byte_offset = 0;
+    byte_length = 0;
+
     val = JS_GetTypedArrayBuffer(ctx, value, &byte_offset, &byte_length, NULL);
     if (!JS_IsException(val)) {
         bytes->start = JS_GetArrayBuffer(ctx, &bytes->length, val);
@@ -967,6 +972,11 @@
     size_t   byte_offset, byte_length;
     JSValue  ab;
 
+    /* GCC complains about uninitialized variables. */
+
+    byte_offset = 0;
+    byte_length = 0;
+
     /* TODO: DataView. */
 
     ab = JS_GetTypedArrayBuffer(ctx, value, &byte_offset, &byte_length,