mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 23:30:37 +02:00
* check validity of calling conventions specified using {$calling x}
(previously, this was only checked for calling conventions specified as a procedure directive) git-svn-id: trunk@12944 -
This commit is contained in:
parent
0d219154f3
commit
a7e02c7948
@ -304,12 +304,16 @@ procedure recordpendingcallingswitch(const str: shortstring);
|
|||||||
|
|
||||||
|
|
||||||
procedure flushpendingswitchesstate;
|
procedure flushpendingswitchesstate;
|
||||||
|
var
|
||||||
|
tmpproccal: tproccalloption;
|
||||||
begin
|
begin
|
||||||
|
{ process pending localswitches (range checking, etc) }
|
||||||
if pendingstate.localswitcheschanged then
|
if pendingstate.localswitcheschanged then
|
||||||
begin
|
begin
|
||||||
current_settings.localswitches:=pendingstate.nextlocalswitches;
|
current_settings.localswitches:=pendingstate.nextlocalswitches;
|
||||||
pendingstate.localswitcheschanged:=false;
|
pendingstate.localswitcheschanged:=false;
|
||||||
end;
|
end;
|
||||||
|
{ process pending verbosity changes (warnings on, etc) }
|
||||||
if pendingstate.verbosityfullswitched then
|
if pendingstate.verbosityfullswitched then
|
||||||
begin
|
begin
|
||||||
status.verbosity:=pendingstate.nextverbosityfullswitch;
|
status.verbosity:=pendingstate.nextverbosityfullswitch;
|
||||||
@ -320,10 +324,15 @@ procedure flushpendingswitchesstate;
|
|||||||
setverbosity(pendingstate.nextverbositystr);
|
setverbosity(pendingstate.nextverbositystr);
|
||||||
pendingstate.nextverbositystr:='';
|
pendingstate.nextverbositystr:='';
|
||||||
end;
|
end;
|
||||||
|
{ process pending calling convention changes (calling x) }
|
||||||
if pendingstate.nextcallingstr<>'' then
|
if pendingstate.nextcallingstr<>'' then
|
||||||
begin
|
begin
|
||||||
if not SetAktProcCall(pendingstate.nextcallingstr,current_settings.defproccall) then
|
if not SetAktProcCall(pendingstate.nextcallingstr,tmpproccal) then
|
||||||
Message1(parser_w_unknown_proc_directive_ignored,pendingstate.nextcallingstr);
|
Message1(parser_w_unknown_proc_directive_ignored,pendingstate.nextcallingstr)
|
||||||
|
else if not(tmpproccal in supported_calling_conventions) then
|
||||||
|
Message1(parser_e_illegal_calling_convention,pendingstate.nextcallingstr)
|
||||||
|
else
|
||||||
|
current_settings.defproccall:=tmpproccal;
|
||||||
pendingstate.nextcallingstr:='';
|
pendingstate.nextcallingstr:='';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user