Update syscall to make syscall_number an unsigned integer instead of an int
This commit is contained in:
@@ -50,10 +50,10 @@ syscall_handler (struct intr_frame *f)
|
||||
{
|
||||
/* First, read the system call number from the stack. */
|
||||
validate_user_pointer (f->esp, 1);
|
||||
int syscall_number = *(int *) f->esp;
|
||||
unsigned syscall_number = *(int *) f->esp;
|
||||
|
||||
/* Ensures the number corresponds to a system call that can be handled. */
|
||||
if (syscall_number < 0 || syscall_number >= LOOKUP_SIZE)
|
||||
if (syscall_number >= LOOKUP_SIZE)
|
||||
thread_exit ();
|
||||
|
||||
syscall_arguments syscall = syscall_lookup[syscall_number];
|
||||
|
||||
Reference in New Issue
Block a user