mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 18:52:07 +00:00
Add recursion limit for INCLUDE and macros
(And REPT.) Not exactly a *recursion* limit, more like a *stack depth* limit, but calling it "recursion" conveys its purpose better. The default of 64 is super overkill: even in a a project with what I believe to be above-average levels of nesting, the level only peaked at 6. Keeping in mind the purpose of this is to catch infinite recursion, which is still caught quickly (in usual cases, anyways), this default seems sensible. And it passes tests. What more do you need?
This commit is contained in:
@@ -35,6 +35,8 @@ struct sContext {
|
||||
uint32_t nREPTBlockSize;
|
||||
};
|
||||
|
||||
extern unsigned int nMaxFileStackDepth;
|
||||
|
||||
void fstk_RunInclude(char *tzFileName);
|
||||
void fstk_RunMacroArg(int32_t s);
|
||||
void fstk_Init(char *s);
|
||||
|
||||
Reference in New Issue
Block a user