mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.52k stars 2.37k forks source link

Fix type mismatch of argv parameters in initcode.S #211

Open snoire opened 8 months ago

snoire commented 8 months ago

In initcode.S, the argv parameters passed to sys_exec were declared as 32-bit long type, which causes a type mismatch with the 64-bit parameter expected by sys_exec. This could introduce undefined behavior if the allocated memory is not cleared.

This PR fixes this by changing the argv parameters to 64-bit quad type. After this change, the memset to clear memory is no longer needed.