Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
sanitized visitors (using IsNull property over internal classname check)
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangSt committed Aug 31, 2011
1 parent d15da9b commit ea1b2a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion IIS.SLSharp/Translation/GLSL/GlslVisitor.cs
Expand Up @@ -436,7 +436,7 @@ public override StringBuilder VisitIfElseStatement(IfElseStatement ifElseStateme
result.Append(Indent(trueSection, trueSection.AcceptVisitor(this, data))); result.Append(Indent(trueSection, trueSection.AcceptVisitor(this, data)));


var elseSection = ifElseStatement.FalseStatement; var elseSection = ifElseStatement.FalseStatement;
if (elseSection.GetType().FullName != "ICSharpCode.NRefactory.CSharp.Statement+NullStatement") if (!elseSection.IsNull)
{ {
result.Append(Environment.NewLine + "else"); result.Append(Environment.NewLine + "else");
result.Append(Indent(elseSection, elseSection.AcceptVisitor(this, data))); result.Append(Indent(elseSection, elseSection.AcceptVisitor(this, data)));
Expand Down
2 changes: 1 addition & 1 deletion IIS.SLSharp/Translation/HLSL/HlslVisitor.cs
Expand Up @@ -480,7 +480,7 @@ public override StringBuilder VisitIfElseStatement(IfElseStatement ifElseStateme
result.Append(Indent(trueSection, trueSection.AcceptVisitor(this, data))); result.Append(Indent(trueSection, trueSection.AcceptVisitor(this, data)));


var elseSection = ifElseStatement.FalseStatement; var elseSection = ifElseStatement.FalseStatement;
if (elseSection.GetType().FullName != "ICSharpCode.NRefactory.CSharp.Statement+NullStatement") if (!elseSection.IsNull)
{ {
result.Append(Environment.NewLine + "else"); result.Append(Environment.NewLine + "else");
result.Append(Indent(elseSection, elseSection.AcceptVisitor(this, data))); result.Append(Indent(elseSection, elseSection.AcceptVisitor(this, data)));
Expand Down

0 comments on commit ea1b2a9

Please sign in to comment.