bugDotGNU Portable.NET - Bugs: bug #14373, pnet2ms produces incorrect...

 
 

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

bug #14373: pnet2ms produces incorrect "using" code

Submitter:  Wayne Richards <wrichards>
Submitted:  Fri 02 Sep 2005 03:56:19 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Discussion

Fri 02 Sep 2005 03:56:19 PM UTC, original submission:  

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.

Wayne Richards <wrichards>

 

Attached Files

Attached Files
file #3433:  tmp.tar.gz added by wrichards (655B - application/gzip - Class1.cs and a Makefile which produce this error. )

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

 

Votes

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

History

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2005-09-02 wrichards Attached File- Added tmp.tar.gz, #2900

Back to the top

Powered by Savane 3.16-a7ba.
Corresponding source code