Merge pull request #445 from Kurausukun/ubfix

Port UBFIX Macro and Some Usages from Emerald
This commit is contained in:
GriffinR
2021-07-03 17:25:05 -04:00
committed by GitHub
13 changed files with 76 additions and 14 deletions
+4
View File
@@ -1628,7 +1628,11 @@ static bool32 IsPartnerActivityAcceptable(u32 activity, u32 group)
if (group == 0xFF)
return TRUE;
#ifndef UBFIX
if (group <= NELEMS(sAcceptedActivityIds)) // UB: <= may access data outside the array
#else
if (group < NELEMS(sAcceptedActivityIds))
#endif
{
const u8 *bytes = sAcceptedActivityIds[group];