浏览代码

+ allow fromsize>tosize in tcgz80.a_load_ref_reg

git-svn-id: branches/z80@45017 -
nickysn 5 年之前
父节点
当前提交
38d3bdc60e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      compiler/z80/cgcpu.pas

+ 2 - 2
compiler/z80/cgcpu.pas

@@ -1467,8 +1467,8 @@ unit cgcpu;
        begin
          if (tcgsize2size[fromsize]>32) or (tcgsize2size[tosize]>32) or (fromsize=OS_NO) or (tosize=OS_NO) then
            internalerror(2011021307);
-         if tcgsize2size[fromsize]>tcgsize2size[tosize] then
-           internalerror(2020040804);
+         if tcgsize2size[fromsize]>=tcgsize2size[tosize] then
+           fromsize:=tosize;
 
          href:=normalize_ref(list,Ref,[OT_REF_ADDR16,OT_REF_HL,OT_REF_IX_d,OT_REF_IY_d],regsused);
          if (tcgsize2size[tosize]=tcgsize2size[fromsize]) or (fromsize in [OS_8,OS_16,OS_32]) then