def _close_block(self):
        done = []
        for n, v in self._st.iteritems():
            if n not in self._live_at_end:
                # self.em.pl("; %s not live" % (n))
                v.decvref(self.em)
                done.append(n)
            else:
                # self.em.pl("; %s live" % (n))
                if n in self._vars_to_raise:
                    # Have to assume that all variables are owned at the end of a block; could get around this with a more complicated analysis phase (or maybe just remove them in a post-processing phase)
                    # similarly for raising
                    v2 = v.convert_to(self.em, self._vars_to_raise[n])
                    if v2.nrefs > 1 or not v2.marked:
                        v3 = v2.split(self.em)
                        v2.decvref(self.em)
                        v2 = v3
                    self._st[n] = v2

        for n in done:
            self._st.pop(n)