OTHER_RES = $(RESOURCE_FILES_1)
TEST_RESOURCE_FILES = \
Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax \
- Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax.cs \
Test/mainsoft/NunitWeb/NunitWeb/Resources/My.ashx \
Test/mainsoft/NunitWeb/NunitWeb/Resources/My.master \
Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx \
return type;
}
+#if NET_2_0
Parse ();
-
+#else
+ try {
+ Parse ();
+ } catch (ParseException ex) {
+ throw new HttpException ("Compilation failed.", ex);
+ }
+#endif
BaseCompiler compiler = GetCompilerFromType ();
type = compiler.GetCompiledType ();
mainsoft/NunitWeb/NunitWeb/CustomSection.cs
mainsoft/NunitWeb/NunitWeb/FakeMembershipProvider.cs
mainsoft/NunitWeb/NunitWeb/FormRequest.cs
+mainsoft/NunitWeb/NunitWeb/Global.asax.cs
mainsoft/NunitWeb/NunitWeb/IForeignData.cs
mainsoft/NunitWeb/NunitWeb/HandlerInvoker.cs
mainsoft/NunitWeb/NunitWeb/MyHandler.cs
string originalHtml = "<a href=\"test\">bla</a>";
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
}
-#endif
- [Test (Description="Bug #525104")]
+ [Test (Description="Bug #524358")]
[ExpectedException (typeof (HttpException))]
public void DuplicateControlsInClientComment ()
{
// Just test if it throws an exception
- new WebTest ("DuplicateControlsInClientCommment.aspx").Run ();
+ new WebTest ("DuplicateControlsInClientComment.aspx").Run ();
}
+#endif
[Test (Description="Bug #517656")]
public void ServerControlInClientSideComment ()
--- /dev/null
+using System;\r
+\r
+namespace MainsoftWebApp\r
+{\r
+ public partial class Global : System.Web.HttpApplication\r
+ {\r
+#if NET_2_0\r
+ protected void Application_Error (object sender, EventArgs e)\r
+ {\r
+ // Code that runs when an unhandled error occurs\r
+ Exception objErr = Server.GetLastError ().GetBaseException ();\r
+ MonoTests.SystemWeb.Framework.WebTest.RegisterException (objErr);\r
+ Server.ClearError ();\r
+ }\r
+\r
+ protected void Application_OnEndRequest (object sender, EventArgs e) {\r
+ // Ensure the headers are sent\r
+ MonoTests.SystemWeb.Framework.WebTest.CurrentTest.SendHeaders ();\r
+ }\r
+#endif\r
+ }\r
+}\r
-<%@ Application Language="C#" Inherits="MainsoftWebApp20.Global" CodeFile="Global.asax.cs" %>\r
+<%@ Application Language="C#" Inherits="MainsoftWebApp.Global" %>
+++ /dev/null
-using System;\r
-\r
-namespace MainsoftWebApp20\r
-{\r
- public partial class Global : System.Web.HttpApplication\r
- {\r
- protected void Application_Error (object sender, EventArgs e)\r
- {\r
- // Code that runs when an unhandled error occurs\r
- Exception objErr = Server.GetLastError ().GetBaseException ();\r
- MonoTests.SystemWeb.Framework.WebTest.RegisterException (objErr);\r
- Server.ClearError ();\r
- }\r
-\r
- protected void Application_OnEndRequest (object sender, EventArgs e) {\r
- // Ensure the headers are sent\r
- MonoTests.SystemWeb.Framework.WebTest.CurrentTest.SendHeaders ();\r
- }\r
- }\r
-}\r
+2009-08-18 Christian Hergert <chris@dronelabs.com>
+
+ * wthreads.c: Roll back change for thread-id as it "embraces
+ and extends" the api by passing word-size for thread id on
+ s390 and amd64.
+
2009-08-18 Christian Hergert <chris@dronelabs.com>
* security.c:
return (0);
}
- g_assert (GPOINTER_TO_INT (thread_handle->id) == GetCurrentThreadId ());
+ g_assert (thread_handle->id == GetCurrentThreadId ());
/* No locking/memory barriers are needed here */
thread_handle->has_apc = TRUE;
return(1);
+2009-08-18 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * class.c (mono_class_get_field_idx): Add fixme for broken
+ behavior for types with multiple fields with the same name.
+ I would rather fix it, but have no idea on how to generate
+ such artifact for testing.
+
+2009-08-18 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * verify.c (verifier_load_field): We should allow references to
+ fields to be made using the generic type definition. It's up to
+ the loader system to fail invalid ops.
+
+ * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
+ are invalid.
+
+2009-08-18 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
+
+ * metadata-internals.h: Fix declaration of
+ mono_metadata_interfaces_from_typedef_full.
+
+ * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
+ heap_alloc_result parameter that controls if the result should be
+ g_malloc'd.
+
+ * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
+ array be g_malloc'd and properly document this public API function.
+
+2009-08-18 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
+ remove METHOD_HEADER_TINY_FORMAT1.
+
+ * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
+
+ * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
+
+ Both spec and MS uses only 2 bits to enumerate the kind of header.
+ So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
+ is superfluous, only used for tiny headers with odd code lengths.
+
+ This change also make sure that mono doesn't wronly interpret bit 2
+ of fat header flags, which is currently reserved.
+
+2009-08-18 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * metadata.c (do_mono_metadata_parse_type): Do error
+ checking for element types. Don't abort if presented
+ with a broken type kind.
+
+2009-08-18 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * metadata.c (mono_metadata_parse_method_signature_full):
+ Gracefully fail bad vararg signatures.
+
2009-08-18 Christian Hergert <chris@dronelabs.com>
* profiler.c:
/*
* 25.2.1: Method header type values
*/
-#define METHOD_HEADER_FORMAT_MASK 7
+#define METHOD_HEADER_FORMAT_MASK 3
#define METHOD_HEADER_TINY_FORMAT 2
-#define METHOD_HEADER_TINY_FORMAT1 6
#define METHOD_HEADER_FAT_FORMAT 3
/*
if (!class->enumtype) {
if (!mono_metadata_interfaces_from_typedef_full (
- image, type_token, &interfaces, &icount, context)){
+ image, type_token, &interfaces, &icount, FALSE, context)){
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
return NULL;
* class->field.first points to the FieldPtr table, while idx points into the
* Field table, so we have to do a search.
*/
+ /*FIXME this is broken for types with multiple fields with the same name.*/
const char *name = mono_metadata_string_heap (class->image, mono_metadata_decode_row_col (&class->image->tables [MONO_TABLE_FIELD], idx, MONO_FIELD_NAME));
int i;
guint32 table_index,
MonoClass ***interfaces,
guint *count,
+ gboolean heap_alloc_result,
MonoGenericContext *context) MONO_INTERNAL;
MonoArrayType *
for (i = 0; i < method->param_count; ++i) {
if (*ptr == MONO_TYPE_SENTINEL) {
- if (method->call_convention != MONO_CALL_VARARG || def)
- g_error ("found sentinel for methoddef or no vararg method");
- if (method->sentinelpos >= 0)
- g_error ("found sentinel twice in the same signature");
+ if (method->call_convention != MONO_CALL_VARARG || def) {
+ g_warning ("found sentinel for methoddef or no vararg method 0x%08x on image %s", def, m->name);
+ g_free (pattrs);
+ return NULL;
+ }
+ if (method->sentinelpos >= 0) {
+ g_warning ("found sentinel twice in the same signature for method 0x%08x on image %s", def, m->name);
+ g_free (pattrs);
+ return NULL;
+ }
method->sentinelpos = i;
ptr++;
}
if (!etype)
return FALSE;
type->data.klass = mono_class_from_mono_type (etype);
+ if (!type->data.klass)
+ return FALSE;
break;
}
case MONO_TYPE_PTR:
break;
case MONO_TYPE_FNPTR:
type->data.method = mono_metadata_parse_method_signature_full (m, container, 0, ptr, &ptr);
+ if (!type->data.method)
+ return FALSE;
break;
case MONO_TYPE_ARRAY:
type->data.array = mono_metadata_parse_array_full (m, container, ptr, &ptr);
+ if (!type->data.array)
+ return FALSE;
break;
case MONO_TYPE_MVAR:
if (container && !container->is_method)
return FALSE;
case MONO_TYPE_VAR:
type->data.generic_param = mono_metadata_parse_generic_param (m, container, type->type, ptr, &ptr);
+ if (!type->data.generic_param)
+ return FALSE;
break;
case MONO_TYPE_GENERICINST:
ok = do_mono_metadata_parse_generic_class (type, m, container, ptr, &ptr);
break;
default:
- g_error ("type 0x%02x not handled in do_mono_metadata_parse_type", type->type);
+ g_warning ("type 0x%02x not handled in do_mono_metadata_parse_type on image %s", type->type, m->name);
+ return FALSE;
}
if (rptr)
mh->code_size = flags >> 2;
mh->code = (unsigned char*)ptr;
return mh;
- case METHOD_HEADER_TINY_FORMAT1:
- mh = mono_image_alloc0 (m, MONO_SIZEOF_METHOD_HEADER);
- ptr++;
- mh->max_stack = 8;
- local_var_sig_tok = 0;
-
- /*
- * The spec claims 3 bits, but the Beta2 is
- * incorrect
- */
- mh->code_size = flags >> 2;
- mh->code = (unsigned char*)ptr;
- return mh;
case METHOD_HEADER_FAT_FORMAT:
fat_flags = read16 (ptr);
ptr += 2;
* mono_metadata_interfaces_from_typedef_full:
* @meta: metadata context
* @index: typedef token
+ * @interfaces: Out parameter used to store the interface array
+ * @count: Out parameter used to store the number of interfaces
+ * @heap_alloc_result: if TRUE the result array will be g_malloc'd
+ * @context: The generic context
*
* The array of interfaces that the @index typedef token implements is returned in
- * @interfaces. The number of elemnts in the array is returned in @count.
+ * @interfaces. The number of elements in the array is returned in @count.
*
* LOCKING: Assumes the loader lock is held.
*
* Returns: TRUE on success, FALSE on failure.
*/
gboolean
-mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, MonoClass ***interfaces, guint *count, MonoGenericContext *context)
+mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, MonoClass ***interfaces, guint *count, gboolean heap_alloc_result, MonoGenericContext *context)
{
MonoTableInfo *tdef = &meta->tables [MONO_TABLE_INTERFACEIMPL];
locator_t loc;
++pos;
}
- result = mono_image_alloc0 (meta, sizeof (MonoClass*) * (pos - start));
+ if (heap_alloc_result)
+ result = g_new0 (MonoClass*, pos - start);
+ else
+ result = mono_image_alloc0 (meta, sizeof (MonoClass*) * (pos - start));
pos = start;
while (pos < tdef->rows) {
return TRUE;
}
+/*
+ * @meta: metadata context
+ * @index: typedef token
+ * @count: Out parameter used to store the number of interfaces
+ *
+ * The array of interfaces that the @index typedef token implements is returned in
+ * @interfaces. The number of elements in the array is returned in @count. The returned
+ * array is g_malloc'd and the caller must free it.
+ *
+ * LOCKING: Acquires the loader lock .
+ *
+ * Returns: the interface array on success, NULL on failure.
+ */
+
MonoClass**
mono_metadata_interfaces_from_typedef (MonoImage *meta, guint32 index, guint *count)
{
gboolean rv;
mono_loader_lock ();
- rv = mono_metadata_interfaces_from_typedef_full (meta, index, &interfaces, count, NULL);
+ rv = mono_metadata_interfaces_from_typedef_full (meta, index, &interfaces, count, TRUE, NULL);
mono_loader_unlock ();
if (rv)
return interfaces;
format = flags & METHOD_HEADER_FORMAT_MASK;
switch (format){
case METHOD_HEADER_TINY_FORMAT:
- case METHOD_HEADER_TINY_FORMAT1:
local_var_sig_token = 0;
break;
case METHOD_HEADER_FAT_FORMAT:
return NULL;
}
- if (!mono_type_is_valid_in_context (ctx, &klass->byval_arg) || !mono_type_is_valid_in_context (ctx, &field->parent->byval_arg))
+ if (!mono_type_is_valid_in_context (ctx, &klass->byval_arg))
return NULL;
- if (klass->generic_container || field->parent->generic_container) {
- ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Cannot reference a field using the generic type definition for %s at 0x%04x", opcode, ctx->ip_offset), MONO_EXCEPTION_BAD_IMAGE);
- return NULL;
- }
-
-
*out_klass = klass;
return field;
}
if (!(class = mono_class_from_mono_type (type)))
ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Could not retrieve type token for %s at 0x%04x", opcode, ctx->ip_offset));
- if (class->generic_container)
+ if (class->generic_container && type->type != MONO_TYPE_GENERICINST)
CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use the generic type definition in a boxable type position for %s at 0x%04x", opcode, ctx->ip_offset));
check_unverifiable_type (ctx, type);
+2009-08-17 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * valid_generic_type_definition_on_boxing_position.cs: Valid encoding of GTD on
+ box position.
+
2009-08-14 Rodrigo Kumpera <rkumpera@novell.com>
*unverifiable_ldobj_with_generic_type_definition.il: Regression test for
--- /dev/null
+using System;
+
+public class Bar<T> {
+ public int Z {get;set;}
+}
+
+public class Foo<T> {
+ public T Test {get;set;}
+ public int Z (Bar<T> t) {
+ return t.Z;
+ }
+}
+
+public struct Cat<T> {
+ T t;
+ public void Test () {
+ Console.WriteLine (GetType ());
+ }
+}
+
+
+class Driver {
+ static void Main () {
+ Cat<int> c = new Cat<int> ();
+ c.Test ();
+ new Foo<double> ().Z(new Bar<double>());
+ }
+}
\ No newline at end of file