Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

In ilasm/tests:

	* test-bounded-array.il: New. Test for [0...], should not lose its 
	lower bound info.

In ilasm/codegen:
	* PeapiTypeRef.cs (PeapiTypeRef.MakeBoundArray): Handle the case when only
	lower bound (no size info) is available.

In class/PEAPI:
	* Metadata.cs (BoundArray.ctor): Don't calculate sizes if upBounds is
	null.

svn path=/trunk/mcs/; revision=54357
  • Loading branch information...
commit d8bfd26a3ce17c802a64eea115140dde5e498869 1 parent 16aacc0
@radical radical authored
View
5 mcs/class/PEAPI/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-14 Ankit Jain <jankit@novell.com>
+
+ * Metadata.cs (BoundArray.ctor): Don't calculate sizes if upBounds is
+ null.
+
2005-12-12 Ankit Jain <jankit@novell.com>
* Metadata.cs (TypeAttr): Add VisibilityMask.
View
2  mcs/class/PEAPI/Metadata.cs
@@ -2175,6 +2175,8 @@ public class BoundArray : Array {
{
numDims = dimensions;
lowerBounds = loBounds;
+ if (upBounds == null)
+ return;
sizes = new int[loBounds.Length];
for (int i=0; i < loBounds.Length; i++) {
sizes[i] = upBounds[i] - loBounds[i] + 1;
View
5 mcs/ilasm/codegen/ChangeLog
@@ -1,5 +1,10 @@
2005-12-14 Ankit Jain <jankit@novell.com>
+ * PeapiTypeRef.cs (PeapiTypeRef.MakeBoundArray): Handle the case when only
+ lower bound (no size info) is available.
+
+2005-12-14 Ankit Jain <jankit@novell.com>
+
* TypeDef.cs (TypeDef.ctor): name_space can be null.
2005-12-13 Ankit Jain <jankit@novell.com>
View
4 mcs/ilasm/codegen/PeapiTypeRef.cs
@@ -149,9 +149,9 @@ public void MakeBoundArray (ArrayList bound_list)
}
}
}
- if (lower_set && size_set) {
+ if (lower_set) {
peapi_type = new PEAPI.BoundArray (peapi_type,
- (uint) dimen, lower_array, size_array);
+ (uint) dimen, lower_array, (size_set ? size_array : null));
} else if (size_set) {
peapi_type = new PEAPI.BoundArray (peapi_type,
(uint) dimen, size_array);
View
5 mcs/ilasm/tests/ChangeLog
@@ -1,5 +1,10 @@
2005-12-14 Ankit Jain <jankit@novell.com>
+ * test-bounded-array.il: New. Test for [0...], should not lose its
+ lower bound info.
+
+2005-12-14 Ankit Jain <jankit@novell.com>
+
* test-array.il: New. Test for tokenizing 0...8
2005-12-14 Ankit Jain <jankit@novell.com>
View
28 mcs/ilasm/tests/test-bounded-array.il
@@ -0,0 +1,28 @@
+//Test case for #76976
+//uint8[0...] should not lose its lower-bound info
+
+.assembly extern mscorlib
+{
+}
+.assembly Output
+{
+ .ver 1:0:0:0
+}
+.module Output
+
+.class private auto autochar beforefieldinit Test
+ extends [mscorlib]System.Object
+{
+ .method public hidebysig static void Main() cil managed
+ {
+ .entrypoint
+ .maxstack 2
+ .locals init (uint8[8] V_0,
+ int32 V_1)
+ ldc.i4.8
+ newobj instance void uint8[0...]::.ctor(int32)
+ pop
+ ret
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.