浏览代码

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

florian 1 周之前
父节点
当前提交
980c128724
共有 1 个文件被更改,包括 2 次插入0 次删除
  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;