Skip to content

Commit

Permalink
unresolved references check added
Browse files Browse the repository at this point in the history
  • Loading branch information
wghost committed Apr 3, 2015
1 parent 36bfe9d commit 15640ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ModScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,12 @@ std::string ModScript::ParseScript(std::string ScriptData, unsigned* ScriptMemSi
do
{
needSecondPass = false;
if (numPasses > 10)
{
*ErrorMessages << "Infinite loop detected (numPasses > 10)!" << std::endl;
SetBad();
return std::string("");
}
if (numPasses != 0) /// no need to parse twice
{
WorkingData.str(ScriptHEX.str());
Expand Down Expand Up @@ -1998,6 +2004,12 @@ std::string ModScript::ParseScript(std::string ScriptData, unsigned* ScriptMemSi
{
ScriptHEX << NextWord << " ";
needSecondPass = true;
if (numPasses != 0 && MarkerLabels.size() == 0)
{
*ErrorMessages << "Unresolved reference: " << NextWord << std::endl;
SetBad();
return std::string("");
}
}
}
if (numPasses == 0)
Expand Down

0 comments on commit 15640ff

Please sign in to comment.