Menu

#11 TestFramework isn't 64bit compatible

v1.0 (example)
open
nobody
None
5
2014-12-27
2014-08-31
Nick Ring
No

constructor TMethodEnumerator.Create has some assembler within the method, which is not allowed when compiling in 64 bit mode. Changes required are:

  while LClass <> nil do
  begin
    // #1 Remove the assembler from here and replace with the next line.
    table := PPointer(PByte(LClass) + vmtMethodTable)^;
    if table <> nil then
    begin
      AName  := Pointer(PAnsiChar(table) + SizeOf(WORD) + SizeOf(WORD) + SizeOf(Pointer)); // #2 64 bit needs more spacing
      for i := 1 to table.count do
      begin
        // check if we've seen the method name
        J := Low(FMethodNameList);
        while (J <= High(FMethodNameList))
        and (string(AName^) <> FMethodNameList[J]) do
          inc(J);
        // if we've seen the name, then the method has probably been overridden
        if J > High(FMethodNameList) then
        begin
          SetLength(FMethodNameList,length(FMethodNameList)+1);
          FMethodNameList[J] := string(AName^);
        end;
        AName := Pointer(PAnsiChar(AName) + length(AName^) + 1 + SizeOf(WORD) + SizeOf(Pointer));  //#3 64 bit needs more spacing
      end;
    end;
    LClass := LClass.ClassParent;
  end;

Discussion


Log in to post a comment.

MongoDB Logo MongoDB