[Mono-bugs] [Bug 74548][Nor] New - corcompare not handling NULL default values correctly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 9 Apr 2005 09:11:00 -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 radical@gmail.com.

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

--- shadow/74548	2005-04-09 09:11:00.000000000 -0400
+++ shadow/74548.tmp.21564	2005-04-09 09:11:00.000000000 -0400
@@ -0,0 +1,57 @@
+Bug#: 74548
+Product: Mono: Tools
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: tools
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: radical@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: corcompare not handling NULL default values correctly
+
+Attached is a patch and two test cases.. 
+
+case1.il :
+<snip>
+    .method public static  hidebysig 
+           default void foo ([opt] int32 param_a)  cil managed
+    {
+    .param [1] = nullref 
+<snip>
+
+case2.il :
+<snip>
+    .method public static  hidebysig 
+           default void foo (int32 param_a)  cil managed
+    {
+<snip>
+
+$ mono mono-api-info.exe case1.dll > c1.xml
+$ mono mono-api-info.exe case2.dll > c2.xml
+$ mono mono-api-diff.exe c1.xml c2.xml > diff.xml
+
+    .method public static  hidebysig 
+           default void foo ([opt] int32 param_a)  cil managed
+    {
+    .param [1] = nullref 
+
+c1.xml does NOT show the default value, even though case1.il has a default
+value for method parameter param_a, value = nullref (see test case)
+
+<parameter name="param_a" position="0" attrib="0" type="System.Int32" />
+
+With the patch:
+
+<parameter name="param_a" position="0" attrib="4112" type="System.Int32"
+optional="true" defaultValue="NULL" />
+
+Explanation of the patch.. if the parameter has NO default value then its
+set to System.DBNull.Value. The default value is NULL when there IS a
+default value and it is = nullref.