Browse Source

* fixed conversion of LOC_JUMP in location_force_reg() for C-style booleans
(usually these are never LOC_JUMP, but it happens for LLVM)

git-svn-id: trunk@33941 -

Jonas Maebe 9 years ago
parent
commit
d5e5ca0531
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/hlcgobj.pas

+ 4 - 1
compiler/hlcgobj.pas

@@ -3934,7 +3934,10 @@ implementation
         LOC_JUMP :
         LOC_JUMP :
           begin
           begin
             a_label(list,l.truelabel);
             a_label(list,l.truelabel);
-            a_load_const_reg(list,dst_size,1,hregister);
+            if is_cbool(src_size) then
+              a_load_const_reg(list,dst_size,-1,hregister)
+            else
+              a_load_const_reg(list,dst_size,1,hregister);
             current_asmdata.getjumplabel(hl);
             current_asmdata.getjumplabel(hl);
             a_jmp_always(list,hl);
             a_jmp_always(list,hl);
             a_label(list,l.falselabel);
             a_label(list,l.falselabel);