Functions with no prototypes might use EAX registers.
This commit is contained in:
parent
a1992702f8
commit
c9ac515286
1 changed files with 17 additions and 11 deletions
|
@ -493,22 +493,28 @@ fncls_t GetFuncInfo (const char* Name, unsigned int* Use, unsigned int* Chg)
|
||||||
** registers.
|
** registers.
|
||||||
*/
|
*/
|
||||||
*Use = REG_EAXY;
|
*Use = REG_EAXY;
|
||||||
} else if (D->ParamCount > 0 &&
|
} else if ((D->ParamCount > 0 ||
|
||||||
|
(D->Flags & FD_EMPTY) != 0) &&
|
||||||
(AutoCDecl ?
|
(AutoCDecl ?
|
||||||
IsQualFastcall (E->Type) :
|
IsQualFastcall (E->Type) :
|
||||||
!IsQualCDecl (E->Type))) {
|
!IsQualCDecl (E->Type))) {
|
||||||
/* Will use registers depending on the last param. If the last
|
/* Will use registers depending on the last param. If the last
|
||||||
** param has incomplete type, just assume __EAX__.
|
** param has incomplete type, or if the function has not been
|
||||||
|
** prototyped yet, just assume __EAX__.
|
||||||
*/
|
*/
|
||||||
switch (SizeOf (D->LastParam->Type)) {
|
if (D->LastParam != 0) {
|
||||||
case 1u:
|
switch (SizeOf(D->LastParam->Type)) {
|
||||||
*Use = REG_A;
|
case 1u:
|
||||||
break;
|
*Use = REG_A;
|
||||||
case 2u:
|
break;
|
||||||
*Use = REG_AX;
|
case 2u:
|
||||||
break;
|
*Use = REG_AX;
|
||||||
default:
|
break;
|
||||||
*Use = REG_EAX;
|
default:
|
||||||
|
*Use = REG_EAX;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*Use = REG_EAX;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Will not use any registers */
|
/* Will not use any registers */
|
||||||
|
|
Loading…
Add table
Reference in a new issue