- respect compacting when limit number of functions

https://forum.zdoom.org/viewtopic.php?t=69374
This commit is contained in:
alexey.lysiuk 2020-07-25 11:05:30 +03:00 committed by Christoph Oelckers
parent aa55fea3e1
commit d60c4901f4

View file

@ -10,6 +10,7 @@
#include <string.h>
#include <stddef.h>
#include <stdio.h>
#include <limits.h>
#include "pcode.h"
#include "common.h"
#include "error.h"
@ -1520,8 +1521,9 @@ void PC_SetScriptVarCount(int number, int type, int varCount, int arrayCount, in
void PC_AddFunction(symbolNode_t *sym, int arrayCount, int *arraySizes)
{
functionInfo_t *function;
int maxFunctionCount = pc_NoShrink ? MAX_FUNCTION_COUNT : (1 << CHAR_BIT * sizeof(U_BYTE));
if(pc_FunctionCount == MAX_FUNCTION_COUNT)
if(pc_FunctionCount == maxFunctionCount)
{
ERR_Error(ERR_TOO_MANY_FUNCTIONS, YES, NULL);
}