* do not interpret procsyms followed by ./^/( as potential procvar

expressions in case of TP/Mac-style procvar modes (mantis #21073)

git-svn-id: trunk@20062 -
This commit is contained in:
Jonas Maebe 2012-01-12 21:37:59 +00:00
parent 1177fadc1c
commit 56161e608d
3 changed files with 30 additions and 2 deletions

1
.gitattributes vendored
View File

@ -12118,6 +12118,7 @@ tests/webtbs/tw20995a.pp svneol=native#text/pascal
tests/webtbs/tw20995b.pp svneol=native#text/pascal
tests/webtbs/tw20998.pp svneol=native#text/pascal
tests/webtbs/tw21029.pp svneol=native#text/plain
tests/webtbs/tw21073.pp svneol=native#text/plain
tests/webtbs/tw2109.pp svneol=native#text/plain
tests/webtbs/tw2110.pp svneol=native#text/plain
tests/webtbs/tw2128.pp svneol=native#text/plain

View File

@ -899,8 +899,9 @@ implementation
getaddr:=true;
end
else
if (m_tp_procvar in current_settings.modeswitches) or
(m_mac_procvar in current_settings.modeswitches) then
if ((m_tp_procvar in current_settings.modeswitches) or
(m_mac_procvar in current_settings.modeswitches)) and
not(token in [_CARET,_POINT,_LKLAMMER]) then
begin
aprocdef:=Tprocsym(sym).Find_procdef_byprocvardef(getprocvardef);
if assigned(aprocdef) then

26
tests/webtbs/tw21073.pp Normal file
View File

@ -0,0 +1,26 @@
{ %norun }
{$mode delphi}
program gpabugtest;
TYPE TGetCurrentProcess = function : THandle; stdcall;
TGetProcAddress = function(const hModule : THandle; const lpProcName : PAnsiChar) : Pointer; stdcall;
function GetProcAddress(const hModule : THandle;const lpProcName : PAnsiChar) : Pointer; stdcall;
begin
result:=nil;
end;
function GetModuleHandle(const lpModuleName : PWideChar) : THandle; stdcall;
begin
result:=thandle(-1);
end;
var proc_GetCurrentProcess : TGetCurrentProcess;
proc_GetProcAddress : TGetProcAddress;
begin
{no error} proc_GetCurrentProcess:=GetProcAddress(GetModuleHandle('Kernel32'),'GetCurrentProcess');
{error ??} proc_GetProcAddress:= GetProcAddress(GetModuleHandle('Kernel32'),'GetProcAddress');
end.