[Mono-bugs] [Bug 80715][Nor] New - mcs NRE in Mono.CSharp.FlowBranching.MergeChild

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Feb 3 14:52:20 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by andyhume32 at yahoo.co.uk.

http://bugzilla.ximian.com/show_bug.cgi?id=80715

--- shadow/80715	2007-02-03 14:52:20.000000000 -0500
+++ shadow/80715.tmp.28947	2007-02-03 14:52:20.000000000 -0500
@@ -0,0 +1,74 @@
+Bug#: 80715
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: XP SP2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: andyhume32 at yahoo.co.uk               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs NRE in Mono.CSharp.FlowBranching.MergeChild
+
+Find below a .cs source file that causes a fatal exception when compiling 
+with mcs.  (gmcs does not fail).  mcs's output is:
+
+------------------
+C:\>mono --debug "D:\Program Files\Mono-1.2.2.1\lib\mono\1.0\mcs.exe"     
+McsNreRepro.cs
+McsNreRepro.cs(6,21): warning CS0162: Unreachable code detected
+McsNreRepro.cs(9,25): error CS0117: `System.Net.Sockets.SocketException' 
+does not contain a definition for `SocketErrorCode'
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: McsNreRepro.cs(4,10):
+                     Block being compiled: [McsNreRepro.cs
+(5,5):,McsNreRepro.cs(12,5):]
+System.NullReferenceException: Object reference not set to an instance of 
+an object
+
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set toan instance of an object
+  at Mono.CSharp.FlowBranching.MergeChild (Mono.CSharp.FlowBranching 
+child) [0x00000] in C:\cygwin\tmp\scratch\mono-1.2.2.1
+\mcs\mcs\flowanalysis.cs:631
+  at Mono.CSharp.EmitContext.DoEndFlowBranching () [0x00018] in 
+C:\cygwin\tmp\scratch\mono-1.2.2.1\mcs\mcs\codegen.cs:592
+  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x001b2] in 
+C:\cygwin\tmp\scratch\mono-1.2.2.1\mcs\mcs\statement.cs:2152
+  at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext 
+anonymous_method_host, Mono.CSharp.ToplevelBlock block, 
+Mono.CSharp.Parameters ip, IMethod
+Data md, System.Boolean& unreachable) [0x000ae] in 
+C:\cygwin\tmp\scratch\mono-1.2.2.1\mcs\mcs\codegen.cs:686
+------------------
+
+gmsc is ok; command: [gmcs McsNreRepro.cs -target:library].  msc fails; 
+command: [mcs McsNreRepro.cs -target:library]  Both Mono-1.2.2.1 and 
+locally built mcs fail.
+
+The code is:
+------------------
+class McsNreRepro
+{
+
+    void aaaa()
+    {
+        if (1 == 0) {
+            try {
+            } catch (System.Net.Sockets.SocketException sex) {
+                int x = (int)sex.SocketErrorCode;
+            }
+        }//if
+    }
+
+}
+------------------
+
+The fault seems dependent on the untaken 'if' in combination with the 
+unknown property.


More information about the mono-bugs mailing list