diff --git a/ThunkLibs/include/common/Host.h b/ThunkLibs/include/common/Host.h index 549c20828..20940e1f1 100644 --- a/ThunkLibs/include/common/Host.h +++ b/ThunkLibs/include/common/Host.h @@ -274,7 +274,7 @@ struct repack_wrapper { ~repack_wrapper() { // TODO: Properly detect opaque types - if constexpr (requires(guest_layout t, decltype(data) h) { t.get_pointer(); (bool)h; *data; }) { + if constexpr (std::is_class_v> && requires(guest_layout t, decltype(data) h) { t.get_pointer(); (bool)h; *data; }) { if (data) { // NOTE: It's assumed that the native host library didn't modify any // const-pointees, so we skip automatic exit repacking for them. @@ -283,8 +283,7 @@ struct repack_wrapper { // memory reserved on entry) if (!fex_apply_custom_repacking_exit(*orig_arg.get_pointer(), *data)) { if constexpr (!std::is_const_v>) { // Skip exit-repacking for const pointees - constexpr bool is_compatible = has_compatible_data_layout && std::is_same_v; - if constexpr (!is_compatible && std::is_class_v>) { + if constexpr (!(has_compatible_data_layout && std::is_same_v)) { *orig_arg.get_pointer() = to_guest(*data); // TODO: Only if annotated as out-parameter } }