Index: kernel/generic/include/interrupt.h
===================================================================
--- kernel/generic/include/interrupt.h	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/generic/include/interrupt.h	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -49,7 +49,8 @@
 { \
 	if (istate_from_uspace(istate)) { \
-		klog_printf("Task %llu killed due to an exception at %p.", TASK->taskid, istate_get_pc(istate)); \
+		task_t *task = TASK; \
+		klog_printf("Task %llu killed due to an exception at %p.", task->taskid, istate_get_pc(istate)); \
 		klog_printf("  " cmd, ##__VA_ARGS__); \
-		task_kill(TASK->taskid); \
+		task_kill(task->taskid); \
 		thread_exit(); \
 	} \
