Add an explicit cast to bool for the if expression so that any base types

that slip in will not cause it to break
0.6.0-stable
Melanie Thielker 2008-09-02 00:03:16 +00:00
parent 0e7bac07f6
commit 146f469524
1 changed files with 2 additions and 2 deletions

View File

@ -470,9 +470,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
{ {
string retstr = String.Empty; string retstr = String.Empty;
retstr += GenerateIndented("if (", ifs); retstr += GenerateIndented("if ((bool)(", ifs);
retstr += GenerateNode((SYMBOL) ifs.kids.Pop()); retstr += GenerateNode((SYMBOL) ifs.kids.Pop());
retstr += GenerateLine(")"); retstr += GenerateLine("))");
// CompoundStatement handles indentation itself but we need to do it // CompoundStatement handles indentation itself but we need to do it
// otherwise. // otherwise.