SEG FAULT help


#1

Hi could someone perhaps more well versed in C++ tell me why the following code is creating a signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000014 ?

From what I understand this is a dangling pointer or some sort of buffer overflow issue…

JSContext cx = ScriptingCore::getInstance~~>getGlobalContext;
cocos2d::CCDirector* cobj = cocos2d::CCDirector::sharedDirector;
cocos2d::CCScene* ret = cobj~~>getRunningScene;
ifreturn;
js_proxy_t
p = jsb_get_native_proxy(ret);
if (!p) return;
jsval retval;
jsval dataVal = INT_TO_JSVAL(keyCode);
ScriptingCore::getInstance()>executeFunctionWithOwner, “onControllerKeyUp”, 1, &dataVal, &retval); <— If I comment out this line the error does not occur
CCLOG (“DOWN keycode %d”,keyCode);