mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 19:29:18 +02:00
* block_type is bt_const when parsing typed consts
This commit is contained in:
parent
6234729fbc
commit
3379959c50
@ -60,6 +60,9 @@ implementation
|
|||||||
{ this procedure reads typed constants }
|
{ this procedure reads typed constants }
|
||||||
procedure readtypedconst(const t:ttype;sym : ttypedconstsym;writable : boolean);
|
procedure readtypedconst(const t:ttype;sym : ttypedconstsym;writable : boolean);
|
||||||
|
|
||||||
|
type
|
||||||
|
setbytes = array[0..31] of byte;
|
||||||
|
Psetbytes = ^setbytes;
|
||||||
var
|
var
|
||||||
len,base : longint;
|
len,base : longint;
|
||||||
p,hp,hpstart : tnode;
|
p,hp,hpstart : tnode;
|
||||||
@ -82,25 +85,24 @@ implementation
|
|||||||
strval : pchar;
|
strval : pchar;
|
||||||
pw : pcompilerwidestring;
|
pw : pcompilerwidestring;
|
||||||
error : boolean;
|
error : boolean;
|
||||||
|
old_block_type : tblock_type;
|
||||||
|
|
||||||
type
|
procedure check_range(def:torddef);
|
||||||
setbytes = array[0..31] of byte;
|
begin
|
||||||
Psetbytes = ^setbytes;
|
if ((tordconstnode(p).value>def.high) or
|
||||||
|
(tordconstnode(p).value<def.low)) then
|
||||||
procedure check_range(def:torddef);
|
begin
|
||||||
begin
|
if (cs_check_range in aktlocalswitches) then
|
||||||
if ((tordconstnode(p).value>def.high) or
|
Message(parser_e_range_check_error)
|
||||||
(tordconstnode(p).value<def.low)) then
|
else
|
||||||
begin
|
Message(parser_w_range_check_error);
|
||||||
if (cs_check_range in aktlocalswitches) then
|
end;
|
||||||
Message(parser_e_range_check_error)
|
end;
|
||||||
else
|
|
||||||
Message(parser_w_range_check_error);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$R-} {Range check creates problem with init_8bit(-1) !!}
|
{$R-} {Range check creates problem with init_8bit(-1) !!}
|
||||||
begin
|
begin
|
||||||
|
old_block_type:=block_type;
|
||||||
|
block_type:=bt_const;
|
||||||
if writable then
|
if writable then
|
||||||
curconstsegment:=datasegment
|
curconstsegment:=datasegment
|
||||||
else
|
else
|
||||||
@ -1017,6 +1019,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
else Message(parser_e_type_const_not_possible);
|
else Message(parser_e_type_const_not_possible);
|
||||||
end;
|
end;
|
||||||
|
block_type:=old_block_type;
|
||||||
end;
|
end;
|
||||||
{$ifdef fpc}
|
{$ifdef fpc}
|
||||||
{$maxfpuregisters default}
|
{$maxfpuregisters default}
|
||||||
@ -1025,7 +1028,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.82 2004-03-18 11:43:57 olle
|
Revision 1.83 2004-04-11 10:44:23 peter
|
||||||
|
* block_type is bt_const when parsing typed consts
|
||||||
|
|
||||||
|
Revision 1.82 2004/03/18 11:43:57 olle
|
||||||
* change AT_FUNCTION to AT_DATA where appropriate
|
* change AT_FUNCTION to AT_DATA where appropriate
|
||||||
|
|
||||||
Revision 1.81 2004/03/17 22:27:41 florian
|
Revision 1.81 2004/03/17 22:27:41 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user