diff --git a/src/common/aarch64/oaknut_util.h b/src/common/aarch64/oaknut_util.h index 16cf7dfe3..12c91dd21 100644 --- a/src/common/aarch64/oaknut_util.h +++ b/src/common/aarch64/oaknut_util.h @@ -23,8 +23,15 @@ inline bool IsWithin128M(const oaknut::CodeGenerator& code, uintptr_t target) { return IsWithin128M(code.xptr<uintptr_t>(), target); } -template <typename T> -inline void CallFarFunction(oaknut::CodeGenerator& code, const T f) { +inline bool IsWithin128M(const oaknut::VectorCodeGenerator& code, uintptr_t target) { + // VectorCodeGenerator is not the final executable memory, so no assumption can be + // made about how far pointers are from each other. + // Always assume far-calls + return false; +} + +template <typename T, typename Policy> +inline void CallFarFunction(oaknut::BasicCodeGenerator<Policy>& code, const T f) { static_assert(std::is_pointer_v<T>, "Argument must be a (function) pointer."); const std::uintptr_t addr = reinterpret_cast<std::uintptr_t>(f); if (IsWithin128M(code, addr)) {