# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/firefox/hotfix-ia64-uniffi-handle.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- firefox-152.0.5/toolkit/components/uniffi-js/Callbacks.cpp.vanilla +++ firefox-152.0.5/toolkit/components/uniffi-js/Callbacks.cpp @@ -40,7 +145,9 @@ // Finally, we always set the lowest bit on the handle. This allows UniFFI to // tell if trait interface handles came from JS or Rust. HandleRefCount* handlePointer = new HandleRefCount(1); - return reinterpret_cast(handlePointer) | 1; + // Convert via uintptr_t: a direct pointer-to-uint64_t cast sign-extends on + // 32-bit targets, producing handles above 2^53 for high heap addresses. + return uint64_t(reinterpret_cast(handlePointer)) | 1; } uint32_t CallbackHandleAddRef(uint64_t aHandle) {