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

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

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
file #3433:  tmp.tar.gz added by wrichards (655B - application/gzip - Class1.cs and a Makefile which produce this error. )


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 add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




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.5