Skip to content

Commit 7374f9b

Browse files
Abseil Teamcopybara-github
authored andcommitted
Fix typo in macro and add missing static_cast for WASM builds.
Corrects `__asjms__` to `__asmjs__` and adds a `static_cast<size_t>` to the result of `getpagesize() - 1`. Without this static cast, emscripten based builds will trigger `-Wsign-conversion` on this line. PiperOrigin-RevId: 827655583 Change-Id: I19b8ed7d3240409127934ac6debcb523fdb73e22
1 parent d1ddbf4 commit 7374f9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

absl/debugging/failure_signal_handler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ const char* FailureSignalToString(int signo) {
157157
#ifdef ABSL_HAVE_SIGALTSTACK
158158

159159
static bool SetupAlternateStackOnce() {
160-
#if defined(__wasm__) || defined(__asjms__)
161-
const size_t page_mask = getpagesize() - 1;
160+
#if defined(__wasm__) || defined(__asmjs__)
161+
const size_t page_mask = static_cast<size_t>(getpagesize()) - 1;
162162
#else
163163
const size_t page_mask = static_cast<size_t>(sysconf(_SC_PAGESIZE)) - 1;
164164
#endif

0 commit comments

Comments
 (0)