diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-07 00:56:37 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-07 00:56:37 +0800 |
commit | cecd643ab2de3e4dbd69e76c58b928ab2aa2a80f (patch) | |
tree | 773d94e7a4309b32d61ee724b8dfd82e2e460221 /main.cpp | |
parent | dd6394d93dc21305e26232891daf5b19c226dd3a (diff) |
list checking fix
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -8,10 +8,11 @@ #ifdef DEBUG extern Cons *empty_list; void tree_print(Cons *ptr) { - if (!ptr || ptr == empty_list) return; ptr->_debug_print(); - tree_print(dynamic_cast<Cons*>(ptr->car)); - tree_print(TO_CONS(ptr->cdr)); + if (ptr->car->is_cons_obj()) + tree_print(TO_CONS(ptr->car)); + if (ptr->cdr->is_cons_obj()) + tree_print(TO_CONS(ptr->cdr)); } #endif |