src: fix multi-base class ObjectWrap::Unwrap<T>()
authorBen Noordhuis <info@bnoordhuis.nl>
Fri, 6 Sep 2013 18:59:27 +0000 (20:59 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Fri, 6 Sep 2013 19:19:55 +0000 (21:19 +0200)
commitb89b97ddedc5b659e5592917d4789a31723ceca3
treefc69b629256d56db417a547b4f7909a12ef46bca
parent756b6222956b5d25b2e7db81f4e79033a3a4d20e
src: fix multi-base class ObjectWrap::Unwrap<T>()

Fix pointer unwrapping when T is a class with more than one base class.

Before this commit, the wrapped void* pointer was cast directly to T*
without going through ObjectWrap* first, possibly leading to a class
instance pointer that points to the wrong vtable.

This change required some cleanup in various files; some classes
used private rather than public inheritance, others didn't derive
from ObjectWrap at all...

Fixes #6188.
src/node_contextify.cc
src/node_crypto.cc
src/node_crypto.h
src/node_object_wrap.h
src/node_stat_watcher.h