From aca3f8f53b9e40c963325d1f93d0b8d4c87a471e Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 15 Nov 2021 12:25:18 -0800 Subject: [PATCH] Fix pthread_attr_t having 9 elems instead of 10 Regression introduced here: https://github.com/emscripten-core/emscripten/pull/13006 We are relying on them having 10 elems thru the `_a_prio` field (in wasm64) and also offsets in library_pthread.js --- system/lib/libc/musl/arch/emscripten/bits/alltypes.h | 6 +++--- tests/reference_struct_info.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/system/lib/libc/musl/arch/emscripten/bits/alltypes.h b/system/lib/libc/musl/arch/emscripten/bits/alltypes.h index 2d727fcafc08e..b8a03756d73af 100644 --- a/system/lib/libc/musl/arch/emscripten/bits/alltypes.h +++ b/system/lib/libc/musl/arch/emscripten/bits/alltypes.h @@ -91,9 +91,9 @@ typedef long suseconds_t; #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) typedef struct { union { - int __i[9]; - volatile int __vi[9]; - unsigned __s[9]; + int __i[10]; + volatile int __vi[10]; + unsigned __s[10]; } __u; #ifdef __EMSCRIPTEN__ // For canvas transfer implementation in Emscripten, use an extra control field diff --git a/tests/reference_struct_info.json b/tests/reference_struct_info.json index 1d2a7b042db9b..0786f571909fb 100644 --- a/tests/reference_struct_info.json +++ b/tests/reference_struct_info.json @@ -1343,8 +1343,8 @@ "tsd": 64 }, "pthread_attr_t": { - "__size__": 40, - "_a_transferredcanvases": 36 + "__size__": 44, + "_a_transferredcanvases": 40 }, "sockaddr": { "__size__": 16,