diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2014-04-05 11:08:16 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2014-04-05 11:08:16 +0400 |
commit | 28d04aec57712fa57da8815172334cba43c92d2c (patch) | |
tree | cb5762a381c3017b8b0e596c19faf0fc8bc0ff14 /ICSharpCode.NRefactory | |
parent | 22d8bc2b80a956617587c11a82164489b155becd (diff) |
Fixed potential blob reader exception.
Diffstat (limited to 'ICSharpCode.NRefactory')
-rw-r--r-- | ICSharpCode.NRefactory/TypeSystem/Implementation/ResolvedAttributeBlob.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ICSharpCode.NRefactory/TypeSystem/Implementation/ResolvedAttributeBlob.cs b/ICSharpCode.NRefactory/TypeSystem/Implementation/ResolvedAttributeBlob.cs index cc40a520..d446b6ff 100644 --- a/ICSharpCode.NRefactory/TypeSystem/Implementation/ResolvedAttributeBlob.cs +++ b/ICSharpCode.NRefactory/TypeSystem/Implementation/ResolvedAttributeBlob.cs @@ -142,9 +142,16 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation return; } foreach (var ctorParameter in ctorParameterTypes.Resolve(context)) { - ResolveResult arg = reader.ReadFixedArg(ctorParameter); - positionalArguments.Add(arg); - if (arg.IsError) { + ResolveResult arg; + bool isError; + try { + arg = reader.ReadFixedArg (ctorParameter); + positionalArguments.Add(arg); + isError = arg.IsError; + } catch (Exception) { + isError = true; + } + if (isError) { // After a decoding error, we must stop decoding the blob because // we might have read too few bytes due to the error. // Just fill up the remaining arguments with ErrorResolveResult: |