Skip to content

Commit

Permalink
Revert previous wrong-change on issue #106; was papering over wrongne…
Browse files Browse the repository at this point in the history
…ss in the runtime. Sad times. Closes #106 more correctly (and adds comment to explain).
  • Loading branch information
graydon committed Jul 12, 2010
1 parent 7c837b8 commit 1843c99
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/boot/me/typestate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,16 @@ let lifecycle_visitor
Ast.STMT_ret _
| Ast.STMT_be _ ->
() (* Taken care of in visit_stmt_post below. *)
| _ ->
let slots = stk_elts_from_bot blk_slots in
| _ ->
(* The blk_slots stack we have has accumulated slots in
* declaration order as we walked the block; the top of the
* stack is the last-declared slot. We want to generate
* slot-drop obligations here for the slots in top-down order
* (starting with the last-declared) but only hitting those
* slots that actually got initialized (went live) at some
* point in the block.
*)
let slots = stk_elts_from_top blk_slots in
let live =
List.filter
(fun i -> Hashtbl.mem live_block_slots i)
Expand Down Expand Up @@ -1122,7 +1130,7 @@ let lifecycle_visitor
(fst f.Ast.for_each_slot).id


| _ -> ()
| _ -> ()
end;
inner.Walk.visit_stmt_pre s
in
Expand All @@ -1133,7 +1141,7 @@ let lifecycle_visitor
Ast.STMT_ret _
| Ast.STMT_be _ ->
let stks = stk_elts_from_top block_slots in
let slots = List.concat (List.map stk_elts_from_bot stks) in
let slots = List.concat (List.map stk_elts_from_top stks) in
let live =
List.filter
(fun i -> Hashtbl.mem live_block_slots i)
Expand Down

0 comments on commit 1843c99

Please sign in to comment.