Re: [edk2] [PATCH] MdeModulePkg/BootManagerMenu: Add assertion to indicate no DIV by 0

2017-04-10 Thread Wu, Hao A
Reviewed-by: Hao Wu Best Regards, Hao Wu > -Original Message- > From: Ni, Ruiyu > Sent: Tuesday, April 11, 2017 10:22 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A > Subject: [PATCH] MdeModulePkg/BootManagerMenu: Add assertion to indicate > no DIV by 0 > > BootMenuSelectItem() cont

[edk2] [PATCH] MdeModulePkg/BootManagerMenu: Add assertion to indicate no DIV by 0

2017-04-10 Thread Ruiyu Ni
BootMenuSelectItem() contains code to DIV BootMenuData->ItemCount. When BootMenuData->ItemCount can be 0, the DIV operation may trigger CPU exception. But in logic, this case won't happen. So add assertion to indicate it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu