nand-nor / dedelf

Deep elf EDitor
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Fix up all required safety checks #13

Open nand-nor opened 4 years ago

nand-nor commented 4 years ago

There are a few points within the modification control flow where numbers are added/subtracted/etc., which in some cases may be large enough to cause panic overflow. Need to change logic at these points to perform checked operations i.e. u64.checked_sub(u64) etc.

Overall need to do extensive code review to ensure any and all possibly dangerous numeric conditions are handled appropriately-- safe up/down casting, checked operations, etc.

nand-nor commented 4 years ago

Note: downcasting from u64 to u32 should be inherently safe-- according to Rust documentation this type of downcasting will truncate bits as needed