Added heuristics for speculative RTTI for gnu 2.96 compilers.

b=62996,r=blizzard,sr=waterson.
This commit is contained in:
rogc%netscape.com 2001-07-13 22:40:04 +00:00
Родитель 8006642304
Коммит ce47970433
2 изменённых файлов: 28 добавлений и 2 удалений

Просмотреть файл

@ -188,7 +188,20 @@ sanity_check_vtable_i386(void** vt)
return 0;
// Is the next instruction a `push %ebx' or `push %esi'?
return (*ip == 0x53 || *ip == 0x56);
if (*ip == 0x53 || *ip == 0x56) {
return 1;
}
// Nope. There's another variant that has a `sub' instruction,
// followed by a `cmpl' and a `jne'. Check for that.
if (ip[0] == 0x83 && ip[1] == 0xec // sub
&& ip[3] == 0x83 && ip[4] == 0x3d // cmpl
&& ip[10] == 0x75 // jne
) {
return 1;
}
return 0;
}
static inline int

Просмотреть файл

@ -188,7 +188,20 @@ sanity_check_vtable_i386(void** vt)
return 0;
// Is the next instruction a `push %ebx' or `push %esi'?
return (*ip == 0x53 || *ip == 0x56);
if (*ip == 0x53 || *ip == 0x56) {
return 1;
}
// Nope. There's another variant that has a `sub' instruction,
// followed by a `cmpl' and a `jne'. Check for that.
if (ip[0] == 0x83 && ip[1] == 0xec // sub
&& ip[3] == 0x83 && ip[4] == 0x3d // cmpl
&& ip[10] == 0x75 // jne
) {
return 1;
}
return 0;
}
static inline int