Fixed: Return NULL when out of bounce

This commit is contained in:
Martin Carlberg
2015-11-20 14:52:53 +01:00
parent e4560df62f
commit 3e0a6ea2cf
+18 -2
View File
@@ -1031,13 +1031,29 @@ GLOBAL(method_getTypes) = function(/*Method*/ aMethod)
GLOBAL(method_copyReturnType) = function(/*Method*/ aMethod)
{
var types = aMethod.method_types;
return types ? types[0] : NULL;
if (types)
{
var argType = types[0];
return argType != NULL ? argType : NULL;
}
else
return NULL;
}
GLOBAL(method_copyArgumentType) = function(/*Method*/ aMethod, /*unsigned int*/ index)
{
var types = aMethod.method_types;
return types ? types[index + 1] : NULL;
if (types)
{
var argType = types[index + 1];
return argType != NULL ? argType : NULL;
}
else
return NULL;
}
GLOBAL(method_getImplementation) = function(/*Method*/ aMethod)