[Mono-bugs] [Bug 74654][Nor] New - mjs can't handle properly code flow where there're two paths an only one returns.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 18 Apr 2005 19:11:39 -0400 (EDT)


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 cesar@ciencias.unam.mx.

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

--- shadow/74654	2005-04-18 19:11:39.000000000 -0400
+++ shadow/74654.tmp.15929	2005-04-18 19:11:39.000000000 -0400
@@ -0,0 +1,50 @@
+Bug#: 74654
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: JScript
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: cesar@ciencias.unam.mx               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mjs can't handle properly code flow where there're two paths an only one returns.
+
+Description of Problem:
+
+Inside a method let's suppose we have to flow paths, and that one of them
+returns and the another don't. mjs generate incorrectly code and at runtime
+if the execution path that don't returns is the one through which the
+execution falls a null reference gets thrown.
+
+
+Steps to reproduce the problem:
+Compile attached test case.
+
+Actual Results:
+cesar@itaca:~/mono/mcs/jtests> rmono not-all-paths-return.exe
+                                                                          
+                                                    
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00042> Microsoft.JScript.Convert:ToString (System.Object value,
+PreferredType pref, Boolean explicitOK)
+in <0x00011> Microsoft.JScript.Convert:ToString (System.Object value,
+Boolean explicitOK)
+in <0x0025a> JScript 0:Global Code ()
+in <0x00054> JScript Main:Main (System.String[] )
+
+
+Expected Results:
+0
+
+How often does this happen? 
+Always.
+
+Additional Information: