[Mono-devel-list] [mono 1.0.2] nested class property gives Segmentation fault

Carlo Salinari csali at tiscali.it
Sun Nov 28 08:10:28 EST 2004


Hello,

I'm getting a segfault from the mono runtime. I was learning to use nested
classes.

Execution terminates when trying to initialize a property
from the nested class constructor (don't even know if is legal).

I present here a short program to show the bug.

Should I file it to bugzilla or is it already resolved in svn?

using System;

public class ShowTheBug
{

    public static void Main (string[] args)
    {
        Console.WriteLine ("HERE");
        NestedClass nescl = new NestedClass ("110", IntPtr.Zero, "salve");
        Console.WriteLine (nescl.Number);
        Console.WriteLine (nescl.Mark);
        Console.WriteLine (nescl.PlainText);
        Console.WriteLine ("THERE");
    }

    public class NestedClass
    {
        public NestedClass (string line_num, IntPtr mark, string line_text)
        {
Console.WriteLine(line_num);
Console.WriteLine(mark);
Console.WriteLine(line_text);
            Number = String.Copy (line_num);
Console.WriteLine("INSIDE CONSTRUCTOR");
            Mark = mark;
            PlainText = String.Copy (line_text);
        }

        public string Number
        {
            get {
                return Number;
            }
            set {
                Number = value;
            }
        }

        public IntPtr Mark
        {
            get {
                return Mark;
            }
            set {
                Mark = value;
            }
        }

        public string PlainText
        {
            get {
                return PlainText;
            }
            set {
                PlainText = value;
            }
        }
    }
}



More information about the Mono-devel-list mailing list