瀏覽代碼

* sign/zero-extend a Pascal boolean (translated to i1) when assigning to
an i8, even though both have byte size 1

git-svn-id: trunk@30713 -

Jonas Maebe 10 年之前
父節點
當前提交
bb4f8e62bf
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      compiler/llvm/llvmdef.pas

+ 11 - 0
compiler/llvm/llvmdef.pas

@@ -210,6 +210,17 @@ implementation
                   end;
                   end;
               end;
               end;
             end
             end
+          else if is_pasbool(fromsize) and
+                  not is_pasbool(tosize) then
+            begin
+              if is_cbool(tosize) then
+                result:=la_sext
+              else
+                result:=la_zext
+            end
+          else if is_pasbool(tosize) and
+                  not is_pasbool(fromsize) then
+            result:=la_trunc
           else
           else
             result:=la_bitcast;
             result:=la_bitcast;
         end;
         end;