From c01a156bff3fa96d5a96182381eb8e64c706fe8d Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Mon, 8 Sep 2025 20:54:41 -0400 Subject: [PATCH] [Metal] Fix MetalModuleCreate This PR fixes a type mismatch in MetalModuleCreate when initializing a MetalModule. The error does not show up until the recent ObjectRef null safety. --- src/runtime/metal/metal_module.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/metal/metal_module.mm b/src/runtime/metal/metal_module.mm index 0439ba47789a..e037717bcc57 100644 --- a/src/runtime/metal/metal_module.mm +++ b/src/runtime/metal/metal_module.mm @@ -270,7 +270,7 @@ void operator()(ffi::PackedArgs args, ffi::Any* rv, const ArgUnion64* pack_args) ICHECK_EQ(sptr_to_self.get(), this); auto it = fmap_.find(name); if (it == fmap_.end()) { - return std::nullopt; + return; } const FunctionInfo& info = it->second; MetalWrappedFunc f; @@ -285,7 +285,7 @@ void operator()(ffi::PackedArgs args, ffi::Any* rv, const ArgUnion64* pack_args) ffi::Module MetalModuleCreate(std::unordered_map smap, std::unordered_map fmap, std::string fmt, std::string source) { - ObjectPtr n; + ObjectPtr n; AUTORELEASEPOOL { n = ffi::make_object(smap, fmap, fmt, source); }; return ffi::Module(n); }