rcore-os / rCore-Tutorial-v3

Let's write an OS which can run on RISC-V in Rust from scratch!
https://rcore-os.github.io/rCore-Tutorial-Book-v3/index.html
GNU General Public License v3.0
1.58k stars 452 forks source link

VirtAddr/PhysAddr::ceil may leads to panic #123

Closed wyfcyx closed 1 year ago

wyfcyx commented 1 year ago

Thanks @kayoch1n. Currently, VirtAddr/PhyAddr::ceil subtracts the address by one before the addition. Therefore, if the input argument is zero, then the subtraction will panic.