Browse Source

Fixed forum-7172: NullReferenceException in C# parser when "fixed" keyword was used incorrectly.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2794 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
635d791b96
  1. 2
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs
  2. 2
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

2
src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs

@ -3809,7 +3809,7 @@ out embeddedStatement);
out type); out type);
#line 1554 "cs.ATG" #line 1554 "cs.ATG"
if (type.PointerNestingLevel == 0) Error("can only fix pointer types"); if (type == null || type.PointerNestingLevel == 0) Error("can only fix pointer types");
List<VariableDeclaration> pointerDeclarators = new List<VariableDeclaration>(1); List<VariableDeclaration> pointerDeclarators = new List<VariableDeclaration>(1);
Identifier(); Identifier();

2
src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

@ -1551,7 +1551,7 @@ EmbeddedStatement<out Statement statement>
| "unsafe" Block<out embeddedStatement> (. statement = new UnsafeStatement(embeddedStatement); .) | "unsafe" Block<out embeddedStatement> (. statement = new UnsafeStatement(embeddedStatement); .)
/*--- fixed statement: */ /*--- fixed statement: */
| "fixed" | "fixed"
"(" Type<out type> (. if (type.PointerNestingLevel == 0) Error("can only fix pointer types"); "(" Type<out type> (. if (type == null || type.PointerNestingLevel == 0) Error("can only fix pointer types");
List<VariableDeclaration> pointerDeclarators = new List<VariableDeclaration>(1); List<VariableDeclaration> pointerDeclarators = new List<VariableDeclaration>(1);
.) .)
Identifier (. string identifier = t.val; .) Identifier (. string identifier = t.val; .)

Loading…
Cancel
Save