[coco] Invoke detach from each Child class (#1713)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 2 Oct 2018 04:57:09 +0000 (13:57 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 2 Oct 2018 04:57:09 +0000 (13:57 +0900)
commitd0708e562a48b03604bab655d5cff26ccc88546e
treeb336278673006607e537db7c37bf291499bf98b0
parentce2b290e08e0f2fc238fc95eca001cb163372d13
[coco] Invoke detach from each Child class (#1713)

* [coco] Invoke detach from each Child class

The current implementation invokes 'detach' inside the destructor of Node.

Unfortunately, this may result in undefined behavior as detach may access the
internal of Child class (through leaving hook), but Child class is already
destructed.

With this commit, unlink on destruction is the responsibility of each
Child class.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
* Add a comment
contrib/coco/core/include/coco/ADT/DLinkedList.h
contrib/coco/core/include/coco/IR/Block.h
contrib/coco/core/include/coco/IR/Instr.h
contrib/coco/core/src/ADT/DLinkedList.test.cpp