浏览代码

* extended r45555 to take care of chars as well

git-svn-id: trunk@45565 -
florian 5 年之前
父节点
当前提交
6d3b74f96e
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      compiler/nadd.pas

+ 6 - 2
compiler/nadd.pas

@@ -1267,9 +1267,11 @@ implementation
                    (not might_have_sideeffects(left)) and
                    (not might_have_sideeffects(right)) and
                    (is_constintnode(taddnode(left).left) or is_constintnode(taddnode(left).right) or
-                    is_constpointernode(taddnode(left).left) or is_constpointernode(taddnode(left).right)) and
+                    is_constpointernode(taddnode(left).left) or is_constpointernode(taddnode(left).right) or
+                    is_constcharnode(taddnode(left).left) or is_constcharnode(taddnode(left).right)) and
                    (is_constintnode(taddnode(right).left) or is_constintnode(taddnode(right).right) or
-                    is_constpointernode(taddnode(right).left) or is_constpointernode(taddnode(right).right)) then
+                    is_constpointernode(taddnode(right).left) or is_constpointernode(taddnode(right).right) or
+                    is_constcharnode(taddnode(right).left) or is_constcharnode(taddnode(right).right)) then
                    begin
                      if is_constnode(taddnode(left).left) then
                        begin
@@ -1296,6 +1298,8 @@ implementation
                          if not(is_integer(v1p^.resultdef)) or not(is_integer(v2p^.resultdef)) then
                            begin
                              case v1p^.resultdef.size of
+                               1:
+                                 inttype:=u8inttype;
                                2:
                                  inttype:=u16inttype;
                                4: