mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Add assertion to symFindMacroArg() to debug oob array access
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
@@ -431,6 +432,8 @@ sym_FindMacroArg(SLONG i)
|
||||
if (i == -1)
|
||||
i = MAXMACROARGS + 1;
|
||||
|
||||
assert(i-1 >= 0 &&
|
||||
i-1 < sizeof(currentmacroargs)/sizeof(*currentmacroargs));
|
||||
return (currentmacroargs[i - 1]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user