mirror of
https://github.com/mrxenginner/reVC.git
synced 2026-10-12 02:08:15 +08:00
fix UB
This commit is contained in:
1 parent
80d15d142d
commit
d89d3db126
1 file changed
+5
@@ -121,7 +121,12 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
|
||||
#endif
|
||||
|
||||
int n = 0;
|
||||
#ifdef FIX_BUGS
|
||||
while (n < ARRAY_SIZE(gaExplosion) && gaExplosion[n].m_nIteration != 0)
|
||||
#else
|
||||
// array overrun is UB
|
||||
while (gaExplosion[n].m_nIteration != 0 && n < ARRAY_SIZE(gaExplosion))
|
||||
#endif
|
||||
n++;
|
||||
if (n == ARRAY_SIZE(gaExplosion))
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user