[Mono-bugs] [Bug 328123] New: Incorrect code generated in System.Data tests

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 25 06:54:38 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=328123

           Summary: Incorrect code generated in System.Data tests
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: rharinath at novell.com
        ReportedBy: lupus at novell.com
         QAContact: mono-bugs at ximian.com
          Found By: ---


The System.Data tests fail because of this:

Failures:
1) MonoTests.System.Data.DataColumnTest2.Expression_Aggregate :
System.InvalidProgramException : Invalid IL code in
MonoTests.System.Data.DataColumnTest2:Expression_Aggregate (): IL_00a5:
stelem.ref

Looking at the code the JIT is correct: the code generated by mcs has an
extraneous dup instruction, see below for the relevant disassembly with the
emulated stack.

        IL_0087:  ldc.i4.6 
        IL_0088:  newarr [mscorlib]System.String
        IL_008d:  dup 
array array
        IL_008e:  ldc.i4.0 
        IL_008f:  ldloc.0 
array array 0 loc0
        IL_0090:  callvirt instance class
[System.Data]System.Data.DataColumnCollection class
[System.Data]System.Data.DataTable::get_Columns()
        IL_0095:  ldstr "expr"
array array 0 colcoll "expr"
        IL_009a:  callvirt instance class [System.Data]System.Data.DataColumn
class [System.Data]System.Data.DataColumnCollection::get_Item(string)
array array 0 datcol
        IL_009f:  dup                                <---------- INCORRECT dup
array array 0 datcol datcol
        IL_00a0:  callvirt instance string class
[System.Data]System.Data.DataColumn::get_Expression()
array array 0 datcol string
        IL_00a5:  stelem.ref                         <---------- FAILS
correctly


The C# code in question is line 673 in Test/System.Data/DataColumnTest2.cs:
                        dt.Columns["expr"].Expression+= " + avg(" +
dt.Columns[0].ColumnName + ") + Min(" + dt.Columns[0].ColumnName + ")" ;


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list