aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-05-06 12:53:37 +0300
committerJukka Jylänki <jujjyl@gmail.com>2014-05-06 12:53:37 +0300
commitfd3d9cc489400b90bb578cab7a6fece69e161fe0 (patch)
treeb3b399a84a35fdb96690067057119673dc6d652a /src
parent0794b09cd748a3ca6eb111d57f8cfcfce852b2a0 (diff)
Apply Chad's fix from issue #2335 to fix other.test_embind.
Diffstat (limited to 'src')
-rw-r--r--src/embind/embind.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 3eadb85f..4821c77b 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -1525,9 +1525,12 @@ function downcastPointer(ptr, ptrClass, desiredClass) {
if (undefined === desiredClass.baseClass) {
return null; // no conversion
}
- // O(depth) stack space used
- return desiredClass.downcast(
- downcastPointer(ptr, ptrClass, desiredClass.baseClass));
+
+ var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass);
+ if (rv === null) {
+ return null;
+ }
+ return desiredClass.downcast(rv);
}
function upcastPointer(ptr, ptrClass, desiredClass) {