aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-02-28 00:58:29 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:24:31 +0300
commit76705c9008a9f075f2c3447079a6650326488376 (patch)
tree552cd3b3d3b3be15038fc54584e3f7129be55933 /src
parent92db1c8c8dd903f71da8a0c191b8c109322e2f48 (diff)
Illegal to pass raw pointer object from JS into smart pointer parameter
Diffstat (limited to 'src')
-rwxr-xr-xsrc/embind/embind.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 08ed7ec1..e850cc3f 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -588,6 +588,9 @@ RegisteredPointer.prototype.toWireType = function(destructors, handle) {
if (!(handle instanceof ClassHandle)) {
throwBindingError('Expected pointer or null, got ' + IMVU.repr(handle));
}
+ if (this.isSmartPointer && undefined === handle.$$.smartPtr) {
+ throwBindingError('Passing raw pointer to smart pointer is illegal');
+ }
if (handle.$$.pointeeType.isPolymorphic) {
fromRawType = handle.$$.pointeeType.getDynamicRawPointerType(handle.$$.ptr);
} else {