Some OBJECT alignment things again

This commit is contained in:
rtldg 2025-03-03 10:18:19 +00:00
parent a998e5e087
commit f3c4c0773c
2 changed files with 8 additions and 1 deletions

View File

@ -61,6 +61,13 @@ x86_64SystemVDefault::x86_64SystemVDefault(std::vector<DataTypeSized_t> &vecArgT
}
}
// Let's pad our objects up since the stack must be aligned by 8 (and potentially 16 or 32).
for (auto& arg : m_vecArgTypes) {
if (arg.type == DATA_TYPE_OBJECT) {
arg.size = Align(arg.size, 8);
}
}
for (const auto& arg : m_vecArgTypes) {
bool found_as_int_or_ptr = false;

View File

@ -727,7 +727,7 @@ void CDynamicHooksSourcePawn::UpdateParamsFromStruct(HookParamsStruct *params)
// Keep track of the seperate stack and register arguments.
if (argTypes[i].custom_register == None) {
#ifdef DYNAMICHOOKS_x86_64
#if defined(DYNAMICHOOKS_x86_64) && defined(PLATFORM_WINDOWS)
stackOffset += 8;
#else
stackOffset += size;