[Mono-bugs] [Bug 28186][Wis] Changed - Doesn't report error CS0177: Out parameter must be assigned before leaving method
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
25 Jul 2002 20:46:37 -0000
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 miguel@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=28186
--- shadow/28186 Thu Jul 25 08:02:10 2002
+++ shadow/28186.tmp.26187 Thu Jul 25 16:46:37 2002
@@ -1,14 +1,14 @@
Bug#: 28186
Product: Mono/MCS
Version: unspecified
-OS:
+OS: unknown
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Wishlist
Component: Misc
AssignedTo: martin@gnome.org
ReportedBy: martin@gnome.org
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
@@ -23,6 +23,35 @@
must
be assigned to before control leaves the current method."
-----
This compiled fine for me with MCS, so MCS fails to report that error.
+
+------- Additional Comments From miguel@ximian.com 2002-07-25 16:46 -------
+This bug requires data flow analysis, basically "out" variables should
+be "definitely assigned" every time we return.
+
+I do not know how to implement this yet, i have been struggling with a
+few ideas.
+
+Guavac did it this way: every variable is tracked in a bit vector, and
+during code forks, the bit vector is duplicated:
+
+if (xxx){
+...
+} else {
+...
+}
+
+Then the bit vectors are merged at this point. This is used to keep
+track of which variables have been definitely assigned, and which ones
+have not. But I am not sure how to map our current variables to
+bitvectors.
+
+Then, when *using* a variable (out parameters and locals are the only
+ones considered in definite assignment) we have to check if it is
+definitely assigned.
+
+And we have to check that all out variables are definitely assigned
+when we return.
+