summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Buchtala <oliver.buchtala@googlemail.com>2014-05-19 15:59:14 +0200
committerOliver Buchtala <oliver.buchtala@googlemail.com>2014-05-19 16:04:22 +0200
commit61b7da1671f5d88127eae0cde4561cd7883c825b (patch)
tree8c26d7573bc351e75fdbdc1ced8696b5c3b84f59
parent3f0f58889131baacb23583a7deb35d9394bfc141 (diff)
downloadswig-61b7da1671f5d88127eae0cde4561cd7883c825b.tar.gz
JavascriptCore: Bugfix for null-pointer support.
This solution must be considered as a preliminary workaround.
-rw-r--r--Lib/javascript/jsc/javascriptrun.swg6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg
index 1ff10a183..ae1567e87 100644
--- a/Lib/javascript/jsc/javascriptrun.swg
+++ b/Lib/javascript/jsc/javascriptrun.swg
@@ -156,7 +156,11 @@ SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr,
SwigPrivData *cdata;
if (ptr == NULL) {
- return JSValueToObject(context, JSValueMakeNull(context), 0);
+ // HACK: it is not possible to use JSValueToObject (causing seg-fault)
+ // This static cast turned out to be a workaround
+ // In future, we should change the interface of this method
+ // to return JSValueRef instead of JSObjectRef.
+ return (JSObjectRef) JSValueMakeNull(context);
}
if(info->clientdata == NULL) {