[Mono-devel-list] Bug? get accessor self-refers

Burton M. Strauss III Burton at ntopsupport.com
Sun May 4 13:55:41 EDT 2003


mono 0.23 - Linux (RedHat 8)

// bug 00002 - seg fault

using System;

    public struct x {
        protected byte p;

        public x(byte i) {
                p=i;
        }

        public byte P {
                get {
                        return P;
                }
        }
    }

class Sample {
    public static void Main() {
        x v = new x(3);
        Console.WriteLine("\tP {0}", v.P );
    }
}

Seg faults when run.  If you change the 'return P' to 'return p', which is
(of course) the correct program, it runs fine.  Shouldn't there be a better
trap than an OS segmentation fault?

-----Burton




More information about the Mono-devel-list mailing list