diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-19 22:12:16 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 06:07:33 +0100 |
commit | 90f203bff189706c2dec34482475b89d0a232597 (patch) | |
tree | a13c16ca7f73b779f941e0543bcff81d97e84b4d /rbtree.h | |
parent | b804417f36ef398f1223e439fd5ac9f2ade046eb (diff) | |
download | sciteco-90f203bff189706c2dec34482475b89d0a232597.tar.gz |
make goto tables local to macro invocation: they are declared on the C++ callstack since macro invocations result in nested macro_execute() calls
otherwise a macro could set labels with program counters which are invalid in other macros/the command line
Diffstat (limited to 'rbtree.h')
-rw-r--r-- | rbtree.h | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -49,16 +49,10 @@ public: { RB_INIT(&head); } - virtual ~RBTree() { - RBEntry *cur; - - while ((cur = min())) { - remove(cur); - delete cur; - } + clear(); } inline RBEntry * @@ -92,6 +86,17 @@ public: { return RB_MAX(Tree, &head); } + + inline void + clear(void) + { + RBEntry *cur; + + while ((cur = min())) { + remove(cur); + delete cur; + } + } }; template <typename KeyType, typename ValueType> |