Commit Graph
43 Commits
Author SHA1 Message Date
Marek Safar feb5080d23 Optimize parameters handling to do much less allocation 2013-02-25 14:11:04 +01:00
Rodrigo Kumpera 2c8c93b378 Remove SRE from Full AOT builds. 2012-11-06 18:18:14 -05:00
Rodrigo Kumpera 83dccf8fe7 Add all missing sequential layout directives to corlib and system. 2011-12-13 11:57:23 -02:00
Rodrigo Kumpera 80e7e4d92b Check for null and valuetypes.
* CustomAttributeBuilder.cs (Initialize): Check if we are
	not passing null as values to valuetypes as this is invalid.

	Fixes #515938
2010-11-30 14:54:27 -02:00
Zoltan Varga 4fc39eebd4 2010-03-30 Zoltan Varga <[email protected]>
* CustomAttributeType.cs (IsValidType): Implement proper checking for value types
	as well.

svn path=/trunk/mcs/; revision=154473
2010-03-30 18:03:26 +00:00
Zoltan Varga 7a53545cf5 2010-03-30 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Fix the calls to IsValidType, some were passing
	in DeclaringType instead of PropertyType/FieldType.

	* CustomAttributeType.cs (IsValidType): Implement proper checking for reference
	types. Fixes #591788.

svn path=/trunk/mcs/; revision=154423
2010-03-30 05:27:31 +00:00
Zoltan Varga 831b96547e 2010-03-30 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (IsValidType): Call Enum.GetUnderlyingType () for
	dynamic enums to avoid crashes in the unmanaged code. Fixes #591800.

svn path=/trunk/mcs/; revision=154419
2010-03-30 03:30:19 +00:00
Zoltan Varga ab8d6a64c9 2010-01-30 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (Initialize): Add more argument checking to avoid
	assertions in the runtime. Fixes #574353.

svn path=/trunk/mcs/; revision=150597
2010-01-30 19:58:35 +00:00
Miguel de Icaza 609edb4d5c System.Reflection.Emit's turn to be de-ifdefified
svn path=/trunk/mcs/; revision=145242
2009-11-03 01:30:22 +00:00
Bill Holmes 18399a6f79 2009-06-25 Sylvain Dupont <[email protected]>
* cominterop.h cominterop.c marshal.c: Added support for marshalling out
	  parameters of type SAFEARRAY[VARIANT].

	* reflection.c (encode_marshal_blob): Properly generate element type
	  (SafeArraySubType marshal attribute option).

	* cominterop.cs libtest.c: Added tests for marshalling
	  out parameters of type SAFEARRAY[VARIANT].

	* CustomAttributeBuilder.cs: Properly handle element type for safe
	  arrays (SafeArraySubType marshal attribute option).

	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=136836
2009-06-25 14:06:50 +00:00
Zoltan Varga 98371dce4e 2008-07-22 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (get_umarshal): Add support for all 
	MarshalAsAttribute fields to fix the build.

svn path=/trunk/mcs/; revision=108453
2008-07-22 10:42:24 +00:00
Zoltan Varga 0da4007745 2008-07-22 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (get_umarshal): Decode enums properly.

svn path=/trunk/mcs/; revision=108425
2008-07-21 22:55:54 +00:00
Marek Safar e47c03a26a 2008-07-21 Marek Safar <[email protected]>
* ParameterBuilder.cs, CustomAttributeBuilder.cs: Check for
	UnmanagedType.ByValArray to be used only on fields.


svn path=/trunk/mcs/; revision=108398
2008-07-21 18:31:59 +00:00
Gert Driesen 68c67fcf27 * TypeBuilderTest.cs: Renamed tests and updated bug number. Enabled
test for UnderlyingSystemType, and improved it. Improved test for
null parent.
* ConstructorOnTypeBuilderInstTest.cs: Enabled test for GetParameters.
* ConstructorBuilderTest.cs: Enabled test for GetParameters. Renamed
test for SetCustomAttribute, and added new tests.
* ModuleBuilderTest.cs: Added tests for bug #387404.
* TypeBuilder.cs: Use Assembly.FullName instead of AssemblyName.
In UnderlyingSystemType, return UnderlyingSystemType of created type
when available. For an enum, UnderlyingSystemType is the type of the
first instance field. If no instance field is available, throw an
InvalidOperationException. Retain original behavior when operating in
compiler context.
* ConstructorBuilder.cs: Moved implementation of GetParameters to
GetParametersInternal to allow it to be used internally when type is
not yet created.
* CustomAttributeBuilder.cs: Added GetParameters method that uses
GetParametersInternal on ConstructorBuilder, and use it where
necessary.

svn path=/trunk/mcs/; revision=102970
2008-05-11 19:13:51 +00:00
Zoltan Varga 6a690c3c7c 2005-11-18 Zoltan Varga <[email protected]>
* ParameterBuilder.cs (SetCustomAttribute): Handle DefaultParameterValueAttribute as well.

	* CustomAttributeBuilder.cs: Add support for decoding more types of
	constructor parameters.

svn path=/trunk/mcs/; revision=53249
2005-11-18 21:14:21 +00:00
Atsushi Eno a8c626d7ca 2005-10-03 Atsushi Enomoto <[email protected]>
* CustomAttributeBuilder.cs : internal attributes should be allowed.
	  Fixed bug #75723.

	* test-458.cs : test for bug #75723.


svn path=/trunk/mcs/; revision=51110
2005-10-03 09:42:33 +00:00
Raja R Harinath 079c2a0710 * CustomAttributeBuilder.cs (get_umarshal): Don't cause a nullref
exception when passed a custom marshaller type that belongs to the
assembly being built.  When user specifies MarshalType rather than
MarshalTypeRef, don't attempt to resolve the type.

svn path=/trunk/mcs/; revision=49263
2005-09-01 12:19:17 +00:00
Raja R Harinath 41bf6b9939 * CustomAttributeBuilder.cs (get_umarshal): Fix typo. The name of
the field is "SizeParamIndex", not "SizeSizeParamIndex".

svn path=/trunk/mcs/; revision=49182
2005-08-31 13:43:26 +00:00
Gert Driesen 25a877e9fd * AssemblyInfo.cs: Fixed AssemblyDescription to match MS.NET.
* Array.cs: Changed protected ctor to private. Fixes API compatibility
with MS.NET.
* RuntimeFieldHandle.cs: Equals methods and GetHashCode should only
be exposed in 2.0 profile.
* RuntimeMethodHandle.cs: Equals methods and GetHashCode should only
be exposed in 2.0 profile.
* RuntimeTypeHandle.cs: Equals methods and GetHashCode should only
be exposed in 2.0 profile.
* Type.cs: Added GetType method and implemented _Type interface.
Fixes API compatibility with MS.NET.
* corlib.dll.sources: Added System.Runtime.InteropServices/
TypeLibImportClassAttribute.cs.
* AssemblyBuilder.cs: Implement _AssemblyBuilder, CA fixes to correspond 
with MS.NET
* ConstructorBuilder.cs: Implement _ConstructorBuilder, CA fixes to
correspond with MS.NET
* CustomAttributeBuilder.cs: Implement _CustomAttributeBuilder, CA
fixes to correspond with MS.NET
* EnumBuilder.cs: Implement _EnumBuilder, CA fixes to correspond with MS.NET
* EventBuilder.cs: Implement _EventBuilder, CA fixes to correspond with MS.NET
* FieldBuilder.cs: Implement _FieldBuilder, CA fixes to correspond with MS.NET
* LocalBuilder.cs: Implement _LocalBuilder, CA fixes to correspond with MS.NET
* MethodBuilder.cs: Implement _MethodBuilder, CA fixes to correspond 
with MS.NET
* MethodRental.cs: CA fixes to correspond with MS.NET, implemented 
_MethodRental.
* ModuleBuilder.cs: Implement _ModuleBuilder, CA fixes to correspond 
with MS.NET
* ILGenerator.cs: Implement _ILGenerator, CA fixes to correspond with MS.NET
* ParameterBuilder.cs Implement _ParameterBuilder, CA fixes to correspond 
with MS.NET
* PropertyBuilder.cs: Implement _PropertyBuilder, CA fixes to correspond 
with MS.NET
* SignatureHelper.cs: Implement _SignatureHelper, CA fixes to correspond 
with MS.NET
* TypeBuilder.cs: Implement _TypeBuilder, CA fixes to correspond with MS.NET
* DecimalConstantAttribute.cs: Only mark ctor not CLSCompliant on 2.0
profile to match MS.NET.
* Assembly.cs: Added GetType() method in 1.1 to match MS.NET.
* ConstructorInfo.cs: Added GetType() method in 1.1 to match MS.NET, 
implemented _ConstructorInfo.
* EventInfo.cs: Added GetType() method in 1.1 to match MS.NET, implemented 
_EventInfo.
* FieldInfo.cs: Added GetType() method in 1.1 to match MS.NET, implemented 
_FieldInfo.
* MemberInfo.cs: Added GetType() method in 1.1 to match MS.NET, implemented 
_MemberInfo.
* MethodBase.cs: Added GetType() method in 1.1 to match MS.NET, implemented 
_MethodBase.
* MethodInfo.cs: Added GetType() method in 1.1 to match MS.NET, implemented 
_MethodInfo.
* PropertyInfo.cs: Added GetType() method in 1.1 to match MS.NET, implemented 
_PropertyInfo.
* TypeAttributes.cs: CustomFormatMask and CustomFormatClass should only be 
exposed in 2.0 profile.

svn path=/trunk/mcs/; revision=48073
2005-08-07 08:48:11 +00:00
Zoltan Varga cd7b342ad7 2005-06-07 Zoltan Varga <[email protected]>
* *.cs: Updates for net 2.0 beta 2.

svn path=/trunk/mcs/; revision=45573
2005-06-07 13:14:31 +00:00
Zoltan Varga 2eca3fdea7 2005-06-03 Zoltan Varga <[email protected]>
* MethodBuilder.cs CustomAttributeBuilder.cs: Rework DllImportAttribute
	decoding to improve compatibility with MS.NET.

svn path=/trunk/mcs/; revision=45380
2005-06-03 19:05:56 +00:00
Zoltan Varga f909eb6296 2005-06-01 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Add a decode_cattr helper method.

svn path=/trunk/mcs/; revision=45307
2005-06-01 19:36:34 +00:00
Lluis Sanchez 4a207370ec 2005-05-25 Lluis Sanchez Gual <[email protected]>
* ModuleBuilder.cs: Implemented DefineDocument(). Generate debug
	info when saving the module.
	* ILGenerator.cs: Keep marked sequence points in a list.
	Added a GenerateDebugInfo method, which dumps the info collected
	during code generation.
	* TypeBuilder.cs:
	* ConstructorBuilder.cs:
	* MethodBuilder.cs: Added method for generating debug info.
	* LocalBuilder.cs: Added StartOffset and EndOffset properties.
	* CustomAttributeBuilder.cs: Use IsInstanceOfType instead of
	IsAssignableFrom when possible.


svn path=/trunk/mcs/; revision=44983
2005-05-25 09:37:07 +00:00
Raja R Harinath e0cfa4925e Set svn:eol-style=native, delete svn:executable.
Fix line endings of System/Decimal.cs (only actual "change" in text, to force recompile of mscorlib to reflect changes in decimal constant handling in the compiler)


svn path=/trunk/mcs/; revision=44558
2005-05-16 12:23:26 +00:00
Zoltan Varga 3ca09f3835 2005-03-01 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs UnmanagedMarshal.cs: Allow sizeConst and
	sizeParamIndex to be -1, which means they are not given.

svn path=/trunk/mcs/; revision=41315
2005-03-01 12:18:05 +00:00
Zoltan Varga b38b240ca3 2005-03-01 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (get_umarshal): Only call the internal
	LPArray creation method if sizeConst of sizeParamIndex is given.

	* UnmanagedMarshal.cs: Add has_size field.

svn path=/trunk/mcs/; revision=41312
2005-03-01 09:56:21 +00:00
Zoltan Varga 634014febd 2005-02-28 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (get_umarshal): Marshal sizeConst and
	sizeParamIndex fields as well.

	* UnmanagedMarshal.cs: Add param_num field and a new internal creation
	method which sets it.

svn path=/trunk/mcs/; revision=41282
2005-02-28 14:12:50 +00:00
Zoltan Varga 9c898b006e 2004-12-16 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Fix a warning.

svn path=/trunk/mcs/; revision=37849
2004-12-16 21:28:44 +00:00
Zoltan Varga 39e1626e53 2004-10-30 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Check that arguments are not
	multi-dimensional arrays.

svn path=/trunk/mcs/; revision=35503
2004-10-30 19:32:08 +00:00
Zoltan Varga f0a00f5f99 2004-09-17 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Applied patch from Marcus Urban ([email protected]). Add support for defining custom marshallers by calling SetCustomAttribute.

svn path=/trunk/mcs/; revision=33997
2004-09-17 10:12:39 +00:00
Duncan Mak 13d1764537 Add license and copyright to all source files in corlib
svn path=/trunk/mcs/; revision=29249
2004-06-11 02:09:36 +00:00
Jackson Harper 659bbbf9ed * CustomAttributeBuilder.cs: GetBlob now takes a ref to the
assembly so it can encode type names properly.

svn path=/trunk/mcs/; revision=28381
2004-05-28 18:59:37 +00:00
Zoltan Varga 2a9356d23e 2004-03-24 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Reenable argument checking with MS.NET
	compatibility tweaks.

svn path=/trunk/mcs/; revision=24518
2004-03-24 12:16:53 +00:00
Zoltan Varga a90895fec7 2004-03-23 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Disable argument checking since it causes
	regressions.

svn path=/trunk/mcs/; revision=24456
2004-03-23 11:30:08 +00:00
Zoltan Varga 4e7119ec6e 2004-03-22 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (Initialize): Add more argument checking.
	Fixes #55793.

svn path=/trunk/mcs/; revision=24425
2004-03-22 17:45:35 +00:00
Jackson Harper 790b27fda9 * CustomAttributeBuilder.cs: Add some argument checking. Handle
default arguments properly.

svn path=/trunk/mcs/; revision=23853
2004-03-09 23:53:27 +00:00
Zoltan Varga 15547c21c3 2004-01-08 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (string_arg): New helper method.

	* AssemblyBuilder.cs (DefineVersionInfoResource): Implement.

	* AssemblyBuilder.cs (SetCustomAttribute): Use the new helper method.

svn path=/trunk/mcs/; revision=21854
2004-01-08 16:35:42 +00:00
Paolo Molaro 203a062db9 Mon Jan 27 17:07:38 CET 2003 Paolo Molaro <[email protected]>
* CustomAttributeBuilder.cs, FieldBuilder.cs: applied
	(reformatted) patch from "Jerome Laban" <[email protected]>
	to fix ByValStr and ByValArray encodings.

svn path=/trunk/mcs/; revision=10951
2003-01-27 16:14:12 +00:00
Gonzalo Paniagua Javier 8772630a90 2002-07-13 Gonzalo Paniagua Javier <[email protected]>
* CustomAttributeBuilder.cs: removed compile warning.

svn path=/trunk/mcs/; revision=5753
2002-07-13 02:21:16 +00:00
Paolo Molaro a8d9b96cc5 Fri Jun 14 16:21:54 CEST 2002 Paolo Molaro <[email protected]>
* CustomAttributeBuilder.cs: added custom attribute related internal
	helper methods.
	* FieldBuilder.cs, ParameterBuilder.cs: handle MarshalAs attribute.
	* UnmanagedMarshal.cs: implemented.

svn path=/trunk/mcs/; revision=5278
2002-06-14 10:39:20 +00:00
Paolo Molaro da5670a148 Fri May 10 20:57:27 CEST 2002 Paolo Molaro <[email protected]>
* CustomAttributeBuilder.cs: expose internal data for use in
	reflection.
	* FieldBuilder.cs, TypeBuilder.cs: special case FieldOffset and
	StructLayout attributes.

svn path=/trunk/mcs/; revision=4489
2002-05-10 15:12:29 +00:00
Paolo Molaro 5476034a3b Wed Feb 20 22:30:49 CET 2002 Paolo Molaro <[email protected]>
* AssemblyBuilder.cs: upped compiled assembly size limit.
	Implemented SetCustomAttribute () methods.
	* CustomAttributeBuilder.cs: implemented the needed constructor
	stuff.
	* Cosntructorbuilder.cs, EnumBuilder.cs, FieldBuilder.cs,
	MethodBuilder.cs, ModuleBuilder.cs, ParameterBuilder.cs,
	PropertyBuilder.cs, TypeBuilder.cs: Implemented SetCustomAttribute () methods.

svn path=/trunk/mcs/; revision=2543
2002-02-20 17:44:02 +00:00
Paolo Molaro c441fe5cc6 Wed Nov 14 16:30:27 CET 2001 Paolo Molaro <[email protected]>
* Linux.cs: a '/' is a valid char in a file path.


Wed Nov 14 16:31:19 CET 2001 Paolo Molaro <[email protected]>

	* AppDomain.cs: rename dummy interface _AppDomain to AppDomain_Intf.
	* Array.cs: fix Array.Copy.
	* AssemblyLoadEventArgs.cs: rename field.
	* CLSCompliantAttribute.cs: use correct name for the class.
	* Char.cs: fix IsLetter.
	* Console.cs, DateTime.cs, Decimal.cs, IConvertible.cs, Math.cs,
	SByte.cs, UInt16.cs, UInt32.cs, UInt64.cs, UIntPtr.cs: CLSCompliant updates.
	* Convert.cs: CLSCompliant updates, add ChangeType() methods.
	* Delegate.cs: renamed target field to m_target.
	* Enum.cs: added missing methods.
	* MonoType.cs: add a constructor and some needed properties.
	* Object.cs: implement GetType().
	* String.cs: CLSCompliant updates. Fixes everywhere to remove the
	ending 0 char.
	* Type.cs: add missing methods/properties.


Wed Nov 14 16:45:49 CET 2001 Paolo Molaro <[email protected]>

	* ArrayList.cs: implement ArrayListEnumerator.
	* Hashtable.cs: hardcode the prime number table.


Wed Nov 14 16:47:07 CET 2001 Paolo Molaro <[email protected]>

	* Calendar.cs: CLSCompliant updates.


Wed Nov 14 16:47:47 CET 2001 Paolo Molaro <[email protected]>

	* CheckPermission.cs: disable ModeAccess() code: it's wrong.
	* FileStream.cs: only trow an exception if the read failed in ReadByte().
	* StreamReader.cs: implement Peek and Read.
	* TextWriter.cs: CLSCompliant updates.


Wed Nov 14 16:53:28 CET 2001 Paolo Molaro <[email protected]>

	* Assembly.cs: implement some of the Load() methods.
	* ConstructorInfo.cs: some missing stubs and fields.
	* FieldInfo.cs: IsInitOnly property.
	* ParameterInfo.cs: stubs for missing properties.
	* ParameterModifier.cs: implemented class.


Wed Nov 14 17:01:45 CET 2001 Paolo Molaro <[email protected]>

	* ConstructorBuilder.cs: added missing stubs and some implementation.
	* CustomAttributeBuilder.cs: added.
	* EventBuilder.cs: added.
	* FieldBuilder.cs: updates.
	* MethodBuilder.cs: stuff to implement P/Invoke methods.
	* ModuleBuilder.cs: added GetArrayMethod() stub.
	* ParameterBuilder.cs, PropertyBuilder.cs: updates.
	* TypeBuilder.cs: updates and stubs.


Wed Nov 14 17:02:57 CET 2001 Paolo Molaro <[email protected]>

	* CallingConvention.cs: add missing Winapi.


Wed Nov 14 17:03:30 CET 2001 Paolo Molaro <[email protected]>

	* IFormatterConverter.cs, SerializationInfo.cs: CLSCompliant updates.


Wed Nov 14 17:04:30 CET 2001 Paolo Molaro <[email protected]>

	* MD5CryptoServiceProvider.cs, SHA1CryptoServiceProvider.cs,
	SHA256Managed.cs: CLSCompliant updates.


Wed Nov 14 17:05:22 CET 2001 Paolo Molaro <[email protected]>

	* Encoding.cs: renamed some fields.
	* StringBuilder.cs: CLSCompliant updates.


Wed Nov 14 17:06:18 CET 2001 Paolo Molaro <[email protected]>

	* Overlapped.cs, ThreadPool.cs, Timer.cs: CLSCompliant updates.

svn path=/trunk/mcs/; revision=1351
2001-11-14 15:18:05 +00:00