From 597674c671ebad005760d9db900b03e6d51694e8 Mon Sep 17 00:00:00 2001 From: "vageyenaman@gmail.com" Date: Fri, 16 Mar 2012 05:25:34 +0000 Subject: [PATCH] Fix for some infinite loop with NTSL parser. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3306 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/scripting/Parser/Parser.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/scripting/Parser/Parser.dm b/code/modules/scripting/Parser/Parser.dm index 9f88fd2227..ad961c755f 100644 --- a/code/modules/scripting/Parser/Parser.dm +++ b/code/modules/scripting/Parser/Parser.dm @@ -171,7 +171,12 @@ NextToken() //skip function name if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis return + var/loops = 0 for() + loops++ + if(loops>=6000) + CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;") + if(!curToken) errors+=new/scriptError/EndOfFile() return