Invalid code generation with Interface calling routine.
Original Reporter info from Mantis: parcel
-
Reporter name: Do-wan Kim
Original Reporter info from Mantis: parcel
- Reporter name: Do-wan Kim
Description:
Simple program with firebird embedded, I got access violation when I make Zconnection.connected := true;
with assembler I got following line of code.
->
zdbinterbase6metadata.pas - 2876 line => 'Result.UpdateString(1,LCatalog);'
Result type is IZResultSet interface.
0065DF13 8b4508 mov 0x8(%ebp),%eax
0065DF16 8b00 mov (%eax),%eax
0065DF18 8b4dec mov -0x14(%ebp),%ecx // LCatalog
0065DF1B ba01000000 mov $0x1,%edx
0065DF20 8b5d08 mov 0x8(%ebp),%ebx
0065DF23 8b1b mov (%ebx),%ebx
0065DF25 8b1b mov (%ebx),%ebx
0065DF27 ff936c010000 call *0x16c(%ebx)
// interface calling routine?
005F2CFF 002d88000000 add %ch,0x88 // actually EIP=005F2D00 (ignore first '00')
005F2D05 8b08 mov (%eax),%ecx // ecx modified, lost LCatalog value.
005F2D07 ffa1bc010000 jmp *0x1bc(%ecx)
->
throw access violation @ string reference increase routine.
string parameter for procedure is delivered by ecx, but ecx modified by caller routine and then throw access violation.
It occured at same code location in both zeosdbo 7.0.6 fixes and 7.1.2 fixes.
Mantis conversion info:
- Mantis ID: 25269
- OS: windows
- OS Build: 7
- Build: 25913
- Platform: x86
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 26101 (#fbca7ee2)
- Target version: 2.7.1