mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Added dist target, lowered recursion depth limit
This commit is contained in:
@@ -1193,7 +1193,7 @@ static void readInterpreterSections(Toy_Interpreter* interpreter);
|
||||
//also supports identifier & arg1 to be other way around (looseFirstArgument)
|
||||
static bool execFnCall(Toy_Interpreter* interpreter, bool looseFirstArgument) {
|
||||
//BUGFIX: depth check - don't drown!
|
||||
if (interpreter->depth >= 1000 * 10) {
|
||||
if (interpreter->depth >= 1000) {
|
||||
interpreter->errorOutput("Infinite recursion detected - panicking\n");
|
||||
interpreter->panic = true;
|
||||
return false;
|
||||
|
||||
@@ -372,8 +372,10 @@ int Toy_hashLiteral(Toy_Literal lit) {
|
||||
case TOY_LITERAL_INTEGER:
|
||||
return hashUInt((unsigned int)TOY_AS_INTEGER(lit));
|
||||
|
||||
case TOY_LITERAL_FLOAT:
|
||||
return hashUInt(*(unsigned int*)(&TOY_AS_FLOAT(lit)));
|
||||
case TOY_LITERAL_FLOAT: {
|
||||
unsigned int* ptr = (unsigned int*)(&TOY_AS_FLOAT(lit));
|
||||
return hashUInt(*ptr);
|
||||
}
|
||||
|
||||
case TOY_LITERAL_STRING:
|
||||
return hashString(Toy_toCString(TOY_AS_STRING(lit)), Toy_lengthRefString(TOY_AS_STRING(lit)));
|
||||
@@ -440,7 +442,7 @@ static void printToBuffer(const char* str) {
|
||||
globalPrintBuffer = TOY_GROW_ARRAY(char, globalPrintBuffer, oldCapacity, globalPrintCapacity);
|
||||
}
|
||||
|
||||
snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str);
|
||||
snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "\0");
|
||||
globalPrintCount += strlen(str);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user