Explorar el Código

Codegen now does not generate useless 'esr 0' instructions anymore

Taddeus Kroes hace 10 años
padre
commit
5395343baf
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      phases/assemble.ml

+ 2 - 2
phases/assemble.ml

@@ -65,8 +65,8 @@ let assemble program =
       end @
       [Comment (sprintf "function \"%s\" with %d parameters and %d local vars"
                         label (List.length params) (indexof node));
-       Label label;
-       RtnEnter (indexof node)] @
+       Label label] @
+      (match indexof node with 0 -> [] | n -> [RtnEnter n]) @
       (trav_all params) @
       (trav body) @
       (match ret_type with Void -> [Ret Void] | _ -> []) @