if (!is_valid_coded_index (ctx, TYPEDEF_OR_REF_DESC, token))
FAIL (ctx, g_strdup_printf ("GenericInst: invalid TypeDefOrRef token %x", token));
+ if (ctx->token) {
+ if (mono_metadata_token_index (ctx->token) == get_coded_index_token (TYPEDEF_OR_REF_DESC, token) &&
+ mono_metadata_token_table (ctx->token) == get_coded_index_table (TYPEDEF_OR_REF_DESC, token))
+ FAIL (ctx, g_strdup_printf ("Type: Recurside generic instance specification (%x). A type signature can't reference itself", ctx->token));
+ }
+
if (!safe_read_cint (count, ptr, end))
FAIL (ctx, g_strdup ("GenericInst: Not enough room for argument count"));
--ptr;
if (signature == 0x07)
return parse_locals_signature (ctx, &ptr, end);
+
+ /*F# and managed C++ produce standalonesig for fields even thou the spec doesn't mention it.*/
+ if (signature == 0x06)
+ return parse_field (ctx, &ptr, end);
+
return parse_method_signature (ctx, &ptr, end, TRUE, TRUE);
}
mono_metadata_decode_row (table, i, data, MONO_TYPEDEF_SIZE);
if (i == 0) {
- if (data [MONO_TYPEDEF_EXTENDS] != 0)
+ /*XXX it's ok if <module> extends object, or anything at all, actually. */
+ /*if (data [MONO_TYPEDEF_EXTENDS] != 0)
ADD_ERROR (ctx, g_strdup_printf ("Invalid typedef row 0 for the special <module> type must have a null extend field"));
+ */
continue;
}
}
}
-/*bits 6,8,9,10,11,13,14,15*/
-#define INVALID_METHOD_IMPLFLAG_BITS ((1 << 6) | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 13) | (1 << 14) | (1 << 15))
+/*bits 8,9,10,11,13,14,15*/
+#define INVALID_METHOD_IMPLFLAG_BITS ((1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 13) | (1 << 14) | (1 << 15))
static void
verify_method_table (VerifyContext *ctx)
{