dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bug #14373] pnet2ms produces incorrect "using" code


From: Wayne Richards
Subject: [Pnet-developers] [bug #14373] pnet2ms produces incorrect "using" code
Date: Fri, 2 Sep 2005 15:56:20 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050724 Firefox/1.0.6

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=14373>

                 Summary: pnet2ms produces incorrect "using" code
                 Project: DotGNU Portable.NET
            Submitted by: wrichards
            Submitted on: Fri 09/02/05 at 15:56
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________

Details:

Attached is sample code which runs correctly under pnet-0.7.2 and 6.2. 
However, pnet2ms produces various exceptions, evidently because Dispose() is
being called on a null object. Pseudocode:

public string fail_function()
{
  using (RegistryKey rk = Registry.LocalMachine.OpenSubKey("some non-existent
key"))
  {
    if (rk!=null) do something // rk is null
  }

  return "something";
}

After running pnet2ms, the function gets a SystemExecutionEngineException,
but this may vary.  Seems like the problem is that the "using" section runs
Dispose() on the
null object rk.






    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 09/02/05 at 15:56  Name: tmp.tar.gz  Size: 655B   By: wrichards
Class1.cs and a Makefile which produce this error. 
<http://savannah.gnu.org/bugs/download.php?item_id=14373&item_file_id=2900>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=14373>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]