From 38e0e0ca29b66b3b72f8bbaf57d112d12273dea6 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 13 May 2010 18:18:33 +0000 Subject: [PATCH] * fixed comment + added extra sanity check when parsing a type constant set + added brackets around or/and expression to make it clear what the meaning is git-svn-id: trunk@15269 - --- compiler/ptconst.pas | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/compiler/ptconst.pas b/compiler/ptconst.pas index 37b3436e6b..ced4c6a101 100644 --- a/compiler/ptconst.pas +++ b/compiler/ptconst.pas @@ -594,14 +594,13 @@ implementation it can generate smallset data instead of normalset (PFV) } inserttypeconv(p,def); { we only allow const sets } - if assigned(tsetconstnode(p).left) then + if (p.nodetype<>setconstn) or + assigned(tsetconstnode(p).left) then Message(parser_e_illegal_expression) else begin tsetconstnode(p).adjustforsetbase; - { this writing is endian independant } - { untrue - because they are considered } - { arrays of 32-bit values CEC } + { this writing is endian-dependant } if source_info.endian = target_info.endian then begin for i:=0 to p.resultdef.size-1 do @@ -775,8 +774,8 @@ implementation result:=true; n:=comp_expr(true); if (n.nodetype <> ordconstn) or - not equal_defs(n.resultdef,def) and - not is_subequal(n.resultdef,def) then + (not equal_defs(n.resultdef,def) and + not is_subequal(n.resultdef,def)) then begin n.free; incompatibletypes(n.resultdef,def);