bugDotGNU Portable.NET - Bugs: bug #1884, cscc bug with delegates and...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #1884: cscc bug with delegates and virtual functions

Submitted by:  None
Submitted on:  Wed 04 Dec 2002 05:42:10 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed 04 Dec 2002 06:32:22 PM UTC, comment #1:

Fixed in CVS ... with a oneliner patch :-)

Gopal.V <t3rmin4t0r>
Project Administrator
Wed 04 Dec 2002 05:42:10 PM UTC, original submission:

Hello All,

Here is the code:

using System;

class Foo
{
public delegate void Del ();

public Foo ()
{
Del del = new Del (Baz);
del.DynamicInvoke (new Object[] {});
}

public virtual void Baz ()
{
Console.WriteLine ("Foo Baz");
}
}

class Bar: Foo
{
public override void Baz ()
{
Console.WriteLine ("Bar Baz");
}
}

class Test
{
public static void Main (String[] args)
{
Foo foo = new Bar ();
}
}

And here are the results:

manyoso@manyoso:~$ mcs foo.cs
Compilation succeeded
manyoso@manyoso:~$ mono foo.exe
Bar Baz
manyoso@manyoso:~$ ilrun foo.exe
Bar Baz
manyoso@manyoso:~$ cscc -o foo.exe foo.cs
manyoso@manyoso:~$ ilrun foo.exe
Uncaught exception: System.Security.VerificationException: Could not verify
the code
at Bar..ctor()
at Test.Main(String[])

manyoso@manyoso:~$ mono foo.exe

Unhandled Exception: System.NullReferenceException: A null value was found
where an object instance was required
in (unmanaged) 00 .Foo:.ctor ()
in <0x00012> 00 .Bar:.ctor ()
in <0x00028> 00 .Test:Main (string[])

Note also that I've tested this program with Microsoft.NET and csc. The code
compiled fine and ran just like it should: "Bar Baz"

Cheers,

Adam

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 04 Dec 2002 06:32:22 PM UTCt3rmin4t0rStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1