ObjFW  Check-in [681e1a13f3]

Overview
Comment:exception.m: Handle read of unaligned values
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 681e1a13f3749daf812a217cab6f1d23708b32b474bb439e7a54a042d7255613
User & Date: js on 2018-04-08 19:32:36
Other Links: manifest | tags
Context
2018-04-08
20:28
+[OFSecureData isSecure]: Check for EPERM check-in: 75ec6edab2 user: js tags: trunk
19:32
exception.m: Handle read of unaligned values check-in: 681e1a13f3 user: js tags: trunk
18:56
configure: Also check for _Unwind_* in libc++ check-in: c16de18443 user: js tags: trunk
Changes

Modified src/runtime/exception.m from [dc5760d5ce] to [5d641d7c4e].

335
336
337
338
339
340
341
342
343


344
345
346
347
348
349
350
351
352
353
read_value(uint8_t enc, const uint8_t **ptr)
{
	uint64_t value;

	if (enc == DW_EH_PE_aligned)
		OBJC_ERROR("DW_EH_PE_aligned is not implemented!")

#define READ(type)				\
	{					\


		value = *(type *)(void *)*ptr;	\
		*ptr += size_for_encoding(enc);	\
		break;				\
	}
	switch (enc & 0x0F) {
	case DW_EH_PE_absptr:
		READ(uintptr_t)
	case DW_EH_PE_uleb128:
		value = read_uleb128(ptr);
		break;







|
|
>
>
|
|
|







335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
read_value(uint8_t enc, const uint8_t **ptr)
{
	uint64_t value;

	if (enc == DW_EH_PE_aligned)
		OBJC_ERROR("DW_EH_PE_aligned is not implemented!")

#define READ(type)					\
	{						\
		type tmp;				\
		memcpy(&tmp, *ptr, sizeof(type));	\
		value = tmp;				\
		*ptr += size_for_encoding(enc);		\
		break;					\
	}
	switch (enc & 0x0F) {
	case DW_EH_PE_absptr:
		READ(uintptr_t)
	case DW_EH_PE_uleb128:
		value = read_uleb128(ptr);
		break;