Browse Source

Fixed possible StackOverflowException in BooBinding.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@689 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
726e726308
  1. 8
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/InferredReturnType.cs

8
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/InferredReturnType.cs

@ -41,8 +41,9 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -41,8 +41,9 @@ namespace Grunwald.BooBinding.CodeCompletion
// clear up references to method/expression after the type has been resolved
if (block != null) {
GetReturnTypeVisitor v = new GetReturnTypeVisitor(context);
v.Visit(block);
block = null;
Block b = block;
block = null; // reset block before calling Visit to prevent StackOverflow
v.Visit(b);
if (v.noReturnStatement)
cachedType = ReflectionReturnType.Void;
else if (v.result is NullReturnType)
@ -50,8 +51,9 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -50,8 +51,9 @@ namespace Grunwald.BooBinding.CodeCompletion
else
cachedType = v.result;
} else if (expression != null) {
cachedType = new BooResolver().GetTypeOfExpression(expression, context);
Expression expr = expression;
expression = null;
cachedType = new BooResolver().GetTypeOfExpression(expr, context);
}
return cachedType;
}

Loading…
Cancel
Save