ich nutze das VirtualTreeView-Package (V. 5.3.2.1) mit Lazarus- und FPC-Trunk unter Windows7. Dabei habe ich das Problem, dass ein External SIGSEGV geworfen wird, sobald ich auf eine Node im Tree eines VirtualStringTrees klicke (Lazarus 1.5 r49472M FPC 3.1.1 r31200). Unter Lazarus 1.4.0 FPC 2.6.4 tritt bei dem gleichen Projekt dieses Fehlverhalten nicht auf. Bis vor ca. einen halben Jahr im Trunk auch nicht (das letzte mal, als ich ein Projekt mit einem VST erstellt hatte).
Code: Alles auswählen
function TBaseVirtualTree.PackArray(TheArray: TNodeArray; Count: Integer): Integer; assembler;
// Removes all entries from the selection array which are no longer in use. The selection array must be sorted for this
// algo to work. Values which must be removed are marked with bit 0 (LSB) set. This little trick works because memory
// is always allocated DWORD aligned. Since the selection array must be sorted while determining the entries to be
// removed it is much more efficient to increment the entry in question instead of setting it to nil (which would break
// the ordered appearance of the list).
//
// On enter EAX contains self reference, EDX the address to TheArray and ECX Count
// The returned value is the number of remaining entries in the array, so the caller can reallocate (shorten)
// the selection array if needed or -1 if nothing needs to be changed.
asm
PUSH EBX
PUSH EDI
PUSH ESI
MOV ECX, EDX //fpc: count is in EDX. Move to ECX
MOV ESI, [EBP+8] //fpc: TheArray is in EBP+8
MOV EDX, -1
JCXZ @@Finish // Empty list?
INC EDX // init remaining entries counter
MOV EDI, ESI // source and destination point to the list memory
MOV EBX, 1 // use a register instead of immediate operant to check against
@@PreScan:
TEST [ESI], EBX // do the fastest scan possible to find the first entry <--- hier kommt es zum SIGSEGVKann diese Fehlverhalten jemand (evtl. unter einem anderen OS) bestätigen?
Kleines Beispiel, welches diesen Fehler auslöst, anbei.