Skip to content

Commit 3900556

Browse files
authored
[Metal] Fix MetalModuleCreate (#18290)
This PR fixes a type mismatch in MetalModuleCreate when initializing a MetalModule. The error does not show up until the recent ObjectRef null safety.
1 parent 36522b2 commit 3900556

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/metal/metal_module.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void operator()(ffi::PackedArgs args, ffi::Any* rv, const ArgUnion64* pack_args)
270270
ICHECK_EQ(sptr_to_self.get(), this);
271271
auto it = fmap_.find(name);
272272
if (it == fmap_.end()) {
273-
return std::nullopt;
273+
return;
274274
}
275275
const FunctionInfo& info = it->second;
276276
MetalWrappedFunc f;
@@ -285,7 +285,7 @@ void operator()(ffi::PackedArgs args, ffi::Any* rv, const ArgUnion64* pack_args)
285285
ffi::Module MetalModuleCreate(std::unordered_map<std::string, std::string> smap,
286286
std::unordered_map<std::string, FunctionInfo> fmap, std::string fmt,
287287
std::string source) {
288-
ObjectPtr<Object> n;
288+
ObjectPtr<MetalModuleNode> n;
289289
AUTORELEASEPOOL { n = ffi::make_object<MetalModuleNode>(smap, fmap, fmt, source); };
290290
return ffi::Module(n);
291291
}

0 commit comments

Comments
 (0)