* write class string message table correctly, resolves #14145

git-svn-id: trunk@13440 -
This commit is contained in:
florian 2009-07-25 12:17:54 +00:00
parent 24f2c7c5cc
commit b4914d063a
3 changed files with 44 additions and 1 deletions

1
.gitattributes vendored
View File

@ -9212,6 +9212,7 @@ tests/webtbs/tw1412.pp svneol=native#text/plain
tests/webtbs/tw14134.pp svneol=native#text/plain
tests/webtbs/tw1414.pp svneol=native#text/plain
tests/webtbs/tw14143.pp svneol=native#text/plain
tests/webtbs/tw14145.pp svneol=native#text/plain
tests/webtbs/tw14149.pp svneol=native#text/plain
tests/webtbs/tw14155.pp svneol=native#text/plain
tests/webtbs/tw1416.pp svneol=native#text/plain

View File

@ -726,7 +726,7 @@ implementation
len:=length(p^.data.messageinf.str^);
current_asmdata.asmlists[al_globals].concat(tai_const.create_8bit(len));
getmem(ca,len+1);
move(p^.data.messageinf.str[1],ca^,len);
move(p^.data.messageinf.str^[1],ca^,len);
ca[len]:=#0;
current_asmdata.asmlists[al_globals].concat(Tai_string.Create_pchar(ca,len));
if assigned(p^.r) then

42
tests/webtbs/tw14145.pp Normal file
View File

@ -0,0 +1,42 @@
{$mode objfpc}
program testm;
uses
Strings;
Type
TMyObject = Class(TObject)
public
Procedure MyMessage(Var Msg); message 'somestring';
end;
TMyMessage = packed record
MsgStr : ShortString;
Data : Pointer;
end;
Var
MyExitCode : Longint;
Procedure TMyObject.MyMessage(Var Msg);
begin
Writeln('Got Message');
MyExitCode:=0;
end;
var
msg : TMyMessage;
M : TMyObject;
s : shortstring;
begin
MyExitCode:=1;
M:=TMyObject.Create;
try
msg.MsgStr:='somestring';
M.DispatchStr(Msg);
finally
M.Free;
end;
halt(MyExitCode);
end.