From: Dmitry Volyntsev Date: Sun, 13 Sep 2026 19:53:30 +0000 (-0700) Subject: Align opaque values X-Git-Tag: 1.0.2~48 X-Git-Url: https://git.kaiwu.me/ngx_http_auth_basic_module.html?a=commitdiff_plain;h=306f0e1a1a3ad40ce71abe942f1f98ee722a827e;p=njs.git Align opaque values Opaque values are cast to njs_value_t pointers by the public API. Match njs_value_t alignment while retaining the four uint32_t filler fields. UndefinedBehaviorSanitizer reports unaligned njs_value_t accesses. --- diff --git a/src/njs.h b/src/njs.h index b33a8568..b6fa1b47 100644 --- a/src/njs.h +++ b/src/njs.h @@ -44,8 +44,9 @@ typedef struct njs_external_s njs_external_t; * sizeof(njs_opaque_value_t) == sizeof(njs_value_t). */ -typedef struct { +typedef union { uint32_t filler[4]; + uint64_t align; } njs_opaque_value_t; /* sizeof(njs_value_t) is 16 bytes. */