ObjFW  Check-in [bd1040a3aa]

Overview
Comment:Fix -[OFDictionary initWithKey:arguments:]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bd1040a3aad213168c68d98f9afedc62437a63d813f7ec236fce81af03d3cd75
User & Date: js on 2024-02-13 21:12:48
Other Links: manifest | tags
Context
2024-02-13
22:06
Don't use max_align_t for OF_BIGGEST_ALIGNMENT check-in: c80075f6e4 user: js tags: trunk
21:13
Merge trunk into branch "objfwtest" check-in: fa70ca352c user: js tags: objfwtest
21:13
Fix -[OFDictionary initWithKey:arguments:] check-in: 3b6f5b8030 user: js tags: 1.0
21:12
Fix -[OFDictionary initWithKey:arguments:] check-in: bd1040a3aa user: js tags: trunk
2024-02-12
19:55
OFMapTable: Fix type mismatch on OFHashSeed check-in: 26ea8fefec user: js tags: trunk
Changes

Modified src/OFDictionary.m from [b6db2734d8] to [4417aedc0d].

315
316
317
318
319
320
321








322
323
324
325
326
327
328
		if (count % 2 != 0)
			@throw [OFInvalidArgumentException exception];

		count /= 2;

		objects = OFAllocMemory(count, sizeof(id));
		keys = OFAllocMemory(count, sizeof(id));









		while ((key = va_arg(arguments, id)) != nil &&
		    (object = va_arg(arguments, id)) != nil) {
			OFEnsure(i < count);

			objects[i] = object;
			keys[i] = key;







>
>
>
>
>
>
>
>







315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
		if (count % 2 != 0)
			@throw [OFInvalidArgumentException exception];

		count /= 2;

		objects = OFAllocMemory(count, sizeof(id));
		keys = OFAllocMemory(count, sizeof(id));

		keys[i] = firstKey;
		objects[i] = va_arg(arguments, id);

		if (objects[i] == nil)
			@throw [OFInvalidArgumentException exception];

		i++;

		while ((key = va_arg(arguments, id)) != nil &&
		    (object = va_arg(arguments, id)) != nil) {
			OFEnsure(i < count);

			objects[i] = object;
			keys[i] = key;