mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix error allocating types for structure
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27932 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bb0412b099
commit
833a2f3b26
1 changed files with 4 additions and 2 deletions
|
@ -470,7 +470,7 @@ cifframe_type(const char *typePtr, const char **advance)
|
|||
{
|
||||
size += (align - (size % align));
|
||||
}
|
||||
ftype = objc_malloc(size + maxtypes*sizeof(ffi_type));
|
||||
ftype = objc_malloc(size + (maxtypes+1)*sizeof(ffi_type));
|
||||
ftype->size = 0;
|
||||
ftype->alignment = 0;
|
||||
ftype->type = FFI_TYPE_STRUCT;
|
||||
|
@ -497,7 +497,9 @@ cifframe_type(const char *typePtr, const char **advance)
|
|||
if (types >= maxtypes)
|
||||
{
|
||||
maxtypes *=2;
|
||||
ftype = objc_realloc(ftype, size + maxtypes*sizeof(ffi_type));
|
||||
ftype = objc_realloc(ftype,
|
||||
size + (maxtypes+1)*sizeof(ffi_type));
|
||||
ftype->elements = (void*)ftype + size;
|
||||
}
|
||||
}
|
||||
ftype->elements[types] = NULL;
|
||||
|
|
Loading…
Reference in a new issue