Bug 1180 - Crash when applying invalid AttributeUsage attribute to a class
Summary: Crash when applying invalid AttributeUsage attribute to a class
Status: RESOLVED UPSTREAM
Alias: None
Product: Compilers
Classification: Mono
Component: VisualBasic ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2011-10-02 15:20 UTC by Lee Millward
Modified: 2018-05-22 11:58 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED UPSTREAM

Description Lee Millward 2011-10-02 15:20:22 UTC
The following invalid code snippet crashes VBNC:

================================
<AttributeUsage(AttributeTargets.XXX)> _
Public Class SomeAttribute
		Inherits Attribute

End Class

================================

With the following error:

Unhandled exception(System.NullReferenceException): Object reference not set to an instance of an object.
   at vbnc.MemberAccessExpression.get_ExpressionType() in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Expressions\MemberAccessExpression.vb:line 125
   at vbnc.Argument.get_AsTypeString() in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Expressions\Argument.vb:line 49
   at vbnc.ArgumentList.get_ArgumentsTypesAsString() in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Expressions\ArgumentList.vb:line 229
   at vbnc.MethodResolver.get_ArgumentsTypesAsString() in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Members\MethodResolver.vb:line 77
   at vbnc.MethodResolver.Resolve() in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Members\MethodResolver.vb:line 160
   at vbnc.MethodGroupClassification.ResolveGroup(ArgumentList SourceParameters, Boolean ShowErrors, Boolean CanBeLateBound) in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Expressions\Classifications\MethodGroupClassification.vb:line 403
   at vbnc.Attribute.ResolveCode(ResolveInfo Info) in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Members\Attribute.vb:line 311
   at vbnc.BaseObjects`1.ResolveCode(ResolveInfo Info) in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\General\BaseObjects`1.vb:line 63
   at vbnc.MemberDeclaration.ResolveCode(ResolveInfo Info) in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\Members\MemberDeclaration.vb:line 154
   at vbnc.TypeDeclaration.ResolveCode(ResolveInfo Info) in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\TypeDeclarations\TypeDeclaration.vb:line 405
   at vbnc.ClassDeclaration.ResolveCode(ResolveInfo Info) in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\TypeDeclarations\ClassDeclaration.vb:line 140
   at vbnc.AssemblyDeclaration.ResolveCode(ResolveInfo Info) in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\TypeDeclarations\AssemblyDeclaration.vb:line 159
   at vbnc.Compiler.Compile_Resolve() in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\General\Compiler.vb:line 414
   at vbnc.Compiler.Compile() in C:\My Stuff\Mono\mono-basic\vbnc\vbnc\source\General\Compiler.vb:line 530
InnerException: (Nothing)
Data.Count: 0
Commandline arguments:
-r:Accessibility.dll
-r:System.Configuration.dll
-r:System.Data.dll
-r:System.Design.dll
-r:System.dll
-r:System.Drawing.Design.dll
-r:System.Drawing.dll
-r:System.Web.dll
-r:System.Web.Services.dll
-r:System.Windows.Forms.dll
-r:System.Xml.dll
-imports:System
-imports:Microsoft.VisualBasic
Object reference not set to an instance of an object.
Compilation took 00:00:00.9375000
Comment 1 Rolf Bjarne Kvinge [MSFT] 2018-05-22 11:58:17 UTC
Moved to: https://github.com/mono/mono-basic/issues/23