Commits

Ronald Oussoren  committed 0d019aa

- Use PyTuple_GET_ITEM instead of PyTuple_GetItem
- Allocate slightly more memory for return values, NSInvocation on GNUstep
seems to copy slightly past the end of the buffer according to valgrind
(alignment issue in memcopy?)

  • Participants
  • Parent commits 68c59e2
  • Branches pyobjc-ancient

Comments (0)

Files changed (1)

File Modules/objc/class-builder.m

 			return;
 		}
 
-		argbuf = PyMem_Malloc(arglen);
+		argbuf = PyMem_Malloc(arglen+64);
 		
 		[invocation getArgument:argbuf atIndex:i];
 
 
 	if (!have_output) {
 		if (*type  != _C_VOID && *type != _C_ONEWAY) {
-			argbuf = PyMem_Malloc(arglen+1);
+			argbuf = PyMem_Malloc(arglen+64);
 
 			err = depythonify_c_value(type, result, argbuf);
 			if (err == -1) {
 			idx = 1;
 			real_res = PyTuple_GET_ITEM(result, 0);
 
-			argbuf = PyMem_Malloc(arglen+1);
+			argbuf = PyMem_Malloc(arglen+64);
 
 			err = depythonify_c_value(type, real_res, argbuf);
 			if (err == -1) {
 		/* The selector is a bound selector, we didn't expect that...*/
 		PyObject* arg_self;
 
-		arg_self = PyTuple_GetItem(arglist, 0);
+		arg_self = PyTuple_GET_ITEM(arglist, 0);
 		if (arg_self == NULL) {
 			return NULL;
 		}