ObjFW  Diff

Differences From Artifact [478a2413e5]:

To Artifact [6215304d3d]:


74
75
76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
74
75
76
77
78
79
80


81

82
83
84
85
86
87
88
89







-
-

-
+







		._Unwind_GetIP = _Unwind_GetIP,
		._Unwind_GetGR = _Unwind_GetGR,
		._Unwind_SetIP = _Unwind_SetIP,
		._Unwind_SetGR = _Unwind_SetGR,
		._Unwind_Resume = _Unwind_Resume,
		.__register_frame_info = __register_frame_info,
		.__deregister_frame_info = __deregister_frame_info,
		.stdout_ = stdout,
		.stderr_ = stderr
	};
	objc_init(&libc);
	objc_init(&libc, stdout, stderr);

	initialized = true;
}

OF_DESTRUCTOR()
{
	CloseLibrary(ObjFWRTBase);
166
167
168
169
170
171
172

173
174

175
176
177
178
179
180
181
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181







+


+







	 * When using the generated inline stubs, the compiler does not emit
	 * any frame information, making the unwind fail. As unwind always
	 * starts from objc_exception_throw(), this means exceptions would
	 * never work. If, however, we're using a function pointer instead of
	 * the inline stub, the compiler does generate a frame and everything
	 * works fine.
	 */
	register void *a6 OBJC_M68K_REG("a6") = ObjFWRTBase;
	uintptr_t throw = (((uintptr_t)ObjFWRTBase) - 0x60);
	((void (*)(id OBJC_M68K_REG("a0")))throw)(object);
	(void)a6;

	OF_UNREACHABLE
}

int
objc_sync_enter(id object)
{
224
225
226
227
228
229
230

231
232





233
234
235
236
237
238
239
240
241
224
225
226
227
228
229
230
231


232
233
234
235
236
237
238
239
240
241
242
243
244
245







+
-
-
+
+
+
+
+









	 * When using the generated inline stubs, the compiler does not emit
	 * any frame information, making the unwind fail. As a result
	 * objc_enumerationMutation() might throw an exception that could never
	 * be caught. If, however, we're using a function pointer instead of
	 * the inline stub, the compiler does generate a frame and everything
	 * works fine.
	 */
	register void *a6 OBJC_M68K_REG("a6") = ObjFWRTBase;
	uintptr_t throw = (((uintptr_t)ObjFWRTBase) - 0x8A);
	((void (*)(id OBJC_M68K_REG("a0")))throw)(object);
	uintptr_t enumerationMutation = (((uintptr_t)ObjFWRTBase) - 0x8A);
	((void (*)(id OBJC_M68K_REG("a0")))enumerationMutation)(object);
	(void)a6;

	OF_UNREACHABLE
}

int
__gnu_objc_personality_v0(int version, int actions, uint64_t ex_class,
    void *ex, void *ctx)
{
	return glue___gnu_objc_personality_v0(version, actions, &ex_class,
	    ex, ctx);
}