2
0
Эх сурвалжийг харах

* 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 -

Jonas Maebe 15 жил өмнө
parent
commit
38e0e0ca29
1 өөрчлөгдсөн 5 нэмэгдсэн , 6 устгасан
  1. 5 6
      compiler/ptconst.pas

+ 5 - 6
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);