private void endScope(int adr) {
        LocalVar v = lvar[adr];
        if (v != null) {
            lvar[adr] = null;
            if (v.start_pc != Character.MAX_VALUE) {
                char length = (char)(curPc() - v.start_pc);
                if (length < Character.MAX_VALUE) {
                    v.length = length;
                    putVar(v);
                }
            }
        }
        state.defined.excl(adr);
    }