From 20fa5aa70d2a5e599ea2604f51baa49c6e891ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sun, 14 Mar 2021 13:28:01 +0100 Subject: check all pointers before dereferencing --- src/userprog/process.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/userprog/process.c') diff --git a/src/userprog/process.c b/src/userprog/process.c index fbf2f50..6170b53 100644 --- a/src/userprog/process.c +++ b/src/userprog/process.c @@ -145,6 +145,8 @@ process_wait (tid_t child_tid) sema_down (&pc->exit_sema); int exit_status = pc->exit_status; pc->exit_status = -1; + sema_up (&pc->exit_sema); // a bit of a hack + // the child is killed so we can read again if we want to return exit_status; } } -- cgit v1.2.1