Răsfoiți Sursa

Fixed a bu in assembly printing causing a single directive not to be printed

Taddeus Kroes 12 ani în urmă
părinte
comite
9b0a2616d9
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      phases/print.ml

+ 1 - 1
phases/print.ml

@@ -154,7 +154,7 @@ let rec print_assembly oc instrs =
   (* Directives (lines beginning with a '.') are collected in endbuf and are
    * printed at the end of the file here. The directives are sorted by the first
    * 7 characters to group directive opcodes *)
-  if List.length !endbuf > 1 then begin
+  if List.length !endbuf > 0 then begin
     output_line (instr2str (Comment ("globals:")));
     let cmp a b = compare (String.sub b 0 7) (String.sub a 0 7) in
     List.iter output_line (List.sort cmp (List.rev !endbuf))