Update syscall to make syscall_number an unsigned integer instead of an int

This commit is contained in:
sBubshait
2024-11-04 00:49:47 +00:00
parent 0d057da3dc
commit 5e2342fad7

View File

@@ -50,10 +50,10 @@ syscall_handler (struct intr_frame *f)
{ {
/* First, read the system call number from the stack. */ /* First, read the system call number from the stack. */
validate_user_pointer (f->esp, 1); 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. */ /* 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 (); thread_exit ();
syscall_arguments syscall = syscall_lookup[syscall_number]; syscall_arguments syscall = syscall_lookup[syscall_number];