Skip to content

Commit c7d1cd6

Browse files
authored
Merge pull request swiftlang#1806 from drodriguez/fix-be-wrong-cast
[CoreFoundation] Fix incorrect cast in _CFRuntimeCreateInstance.
2 parents 101216e + fdf818b commit c7d1cd6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: CoreFoundation/Base.subproj/CFRuntime.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ CFTypeRef _CFRuntimeCreateInstance(CFAllocatorRef allocator, CFTypeID typeID, CF
443443
memset(&memory->_cfinfoa, 0, size - (sizeof(memory->_cfisa) + sizeof(memory->_swift_rc)));
444444

445445
// Set up the cfinfo struct
446-
uint32_t *cfinfop = (uint32_t *)&(memory->_cfinfoa);
446+
uint64_t *cfinfop = (uint64_t *)&(memory->_cfinfoa);
447447
// The 0x80 means we use the default allocator
448-
*cfinfop = (uint32_t)(((uint32_t)typeID << 8) | (0x80));
449-
448+
*cfinfop = ((typeID << 8) | (0x80));
449+
450450
return memory;
451451
#else
452452
if (__CFRuntimeClassTableSize <= typeID) HALT;

0 commit comments

Comments
 (0)