ObjFW  Check-in [3b6f5b8030]

Overview
Comment:Fix -[OFDictionary initWithKey:arguments:]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 1.0
Files: files | file ages | folders
SHA3-256: 3b6f5b8030fe47db7f4d96a49d69aa13eaac784cafc16e0657778e8b880de9da
User & Date: js on 2024-02-13 21:13:06
Other Links: branch diff | manifest | tags
Context
2024-02-18
13:53
OFMapTable: Improve enumeration mutation detection check-in: 2b0bdf3efc user: js tags: 1.0
2024-02-13
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: 0cc973c595 user: js tags: 1.0
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;