[core] Fix Callback invocation for function pointer callables

Use (*ptr)(args...) instead of ptr->operator()(args...) so the
inline path works correctly for function pointers, which are
trivially copyable and pointer-sized but lack operator().
This commit is contained in:
J. Nick Koston
2026-03-15 22:39:31 -10:00
parent 3cebea9538
commit 70733fa913
+1 -1
View File
@@ -1756,7 +1756,7 @@ template<typename... Ts> struct Callback<void(Ts...)> {
cb.fn = [](void *c, Ts... args) {
alignas(DecayF) char buf[sizeof(DecayF)];
__builtin_memcpy(buf, &c, sizeof(DecayF));
reinterpret_cast<DecayF *>(buf)->operator()(args...);
(*reinterpret_cast<DecayF *>(buf))(args...);
};
return cb;
} else {