Skip to content

Commit

Permalink
Fix some issues with labels
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLane committed Nov 25, 2016
1 parent 4b7fbec commit a922042
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/codegenx86.ml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ let codegenx86_break _ =

(* Instruction to jump to a label and create a new label*)
let codegenx86_jmplbl x y =
"\tjmp .L" ^ (string_of_int x) ^ "\n"
|> add_string code;
codegenx86_lbl y

(* Instructions to test and jump if gate zero *)
Expand Down Expand Up @@ -245,6 +243,7 @@ let rec codegenx86 symt = function
| If (x, e1, e2) ->
let oldexit = !exitp in
codegenx86 symt x;
lblp := !lblp + 1;
codegenx86_testjz ();
lblp := !lblp + 1;
sp := !sp - 1;
Expand All @@ -255,7 +254,6 @@ let rec codegenx86 symt = function
codegenx86 symt e2;
exitp := oldexit;
codegenx86_lbl (!lblp - 1);
lblp := !lblp + 1
| While (x, e) ->
codegenx86_jmplbl (!lblp) (!lblp + 1);
lblp := !lblp + 1;
Expand Down

0 comments on commit a922042

Please sign in to comment.