[Mono-devel-list] patch for crash in locales.c (on cygwin), second try

Lluis Sanchez lluis at ximian.com
Wed Apr 21 19:33:29 EDT 2004


Hi,

It was a bug in CaseInsensitiveHashCodeProvider, which assumed that
Char.ToLower could take null as culture. The fix is now in cvs.

Lluis.

On dc, 2004-04-21 at 23:46, Urs Muff wrote:
> Index: locales.c
> ===================================================================
> RCS file: /cvs/public/mono/mono/metadata/locales.c,v
> retrieving revision 1.16
> diff -u -r1.16 locales.c
> --- locales.c   21 Apr 2004 14:58:37 -0000      1.16
> +++ locales.c   21 Apr 2004 21:08:17 -0000
> @@ -1434,10 +1434,10 @@
>  #endif
> 
>  #ifdef DEBUG
> -       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult->lcid);
> +       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult == NULL ? -1
> : cult->lcid);
>  #endif
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>  #ifdef DEBUG
>                 g_message (G_GNUC_PRETTY_FUNCTION
>                            ": Invariant, using shortcut");
> @@ -1503,10 +1503,10 @@
>  #endif
> 
>  #ifdef DEBUG
> -       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult->lcid);
> +       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult == NULL ? -1
> : cult->lcid);
>  #endif
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>  #ifdef DEBUG
>                 g_message (G_GNUC_PRETTY_FUNCTION
>                            ": Invariant, using shortcut");
> @@ -1567,7 +1567,7 @@
> 
>         MONO_ARCH_SAVE_REGS;
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>                 /* Invariant shortcut */
>                 return g_unichar_toupper (c);
>         }
> @@ -1599,7 +1599,7 @@
> 
>         MONO_ARCH_SAVE_REGS;
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>                 /* Invariant shortcut */
>                 return g_unichar_tolower (c);
>         }
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list