Parcourir la source

* throw an error if sizeof in the scanner is applied to a type having no defined size

florian il y a 2 jours
Parent
commit
980c128724
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      compiler/scanner.pas

+ 2 - 0
compiler/scanner.pas

@@ -2081,6 +2081,8 @@ type
                                 end;
                               typesym:
                                 begin
+                                  if ttypesym(srsym).typedef.typ in [errordef,abstractdef,forwarddef] then
+                                    Message(parser_e_illegal_expression);
                                   l:=ttypesym(srsym).typedef.size;
                                   MarkSymbolAsUsed(srsym);
                                 end;