SUNITINACTIVE_SaveOrFreeUnit: the stack slot [EBP-4] (local_8) is a 4-byte BOOL
Ghidra v1866 · 4b0cf0b
Stack[-0x8] ([EBP-4] after push ebp/mov ebp,esp) is the save flag and every access is a dword: 0054340e MOV dword ptr [EBP-4],0; 00543440 MOV dword ptr [EBP-4],1; 0054347c / 00543492 MOV dword ptr [EBP-4],0; 005434a6 CMP dword ptr [EBP-4],0 / JZ 005434b4 (skips the SUNITINACTIVE_SaveInactiveUnit call at 005434af). It only ever holds 0 or 1, so it is a BOOL. The database prints the flag through a 1-byte HASH bool (bShouldSave) and leaves this slot as an untyped local_8; typing the slot gives the flag its real 4-byte storage (the HASH bool then becomes redundant; a propose cannot delete it). VC8 oracle on main a9d994e with the flag as a stack BOOL: 005433f0 INSN_MATCH -> MATCH, +1, 0 lost.
Changes 1, applied together
Retype variable
win 0x005433f0 Stack[-0x8]typeundefined4→BOOL