Your message dated Wed, 8 Jan 2014 18:51:55 +0100
with message-id <[email protected]>
and subject line Re: Bug#711103: /usr/bin/mcs: Wrong IL generated for struct +
implicit string cast + null comparison
has caused the Debian Bug report #711103,
regarding /usr/bin/mcs: Wrong IL generated for struct + implicit string cast +
null comparison
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
711103: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711103
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mono-mcs
Version: 3.0.6+dfsg2-4
Severity: normal
File: /usr/bin/mcs
Dear Maintainer,
It seems mcs generates IL that simply does not make sense (and differs
to what Visual Studio generates) for the following source code:
using System;
namespace PHP
{
public struct FullPath
{
private string path;
public FullPath(string arbitraryPath)
{
this.path = arbitraryPath;
}
public static implicit operator string(FullPath fullPath)
{
return fullPath.path;
}
}
class FullPathTest
{
public static void Main (string[] args)
{
FullPath fp = new FullPath ("/etc/passwd");
Console.WriteLine ("Comparing with == : " +
(fp == null ? "true" : "false") + "; expected: false");
Console.WriteLine ("Comparing with != : " +(fp
!= null ? "true" : "false") + "; expected: true");
Console.WriteLine ();
}
}
}
Here's a snippet of monodis output for assembly generated with mono
compiler:
IL_000c: ldstr "Comparing with == : "
IL_0011: ldloc.0
IL_0012: call string valuetype
PHP.FullPath::op_Implicit(valuetype PHP.FullPath)
IL_0017: ldloc.0 // should be ldnull (!)
IL_0018: call string valuetype
PHP.FullPath::op_Implicit(valuetype PHP.FullPath) // this line should
not be present at all
IL_001d: call bool string::op_Equality(string, string)
IL_0022: brfalse IL_0031
IL_0027: ldstr "true"
IL_002c: br IL_0036
IL_0031: ldstr "false"
IL_0036: ldstr "; expected: false"
IL_003b: call string string::Concat(string, string, string)
IL_0040: call void class [mscorlib]System.Console::WriteLine(string)
Here's what Visual Studio 2012 Express generates:
IL_000e: ldstr "Comparing with == : "
IL_0013: ldloc.0
IL_0014: call string valuetype
PHP.FullPath::op_Implicit(valuetype PHP.FullPath)
IL_0019: ldnull
IL_001a: call bool string::op_Equality(string, string)
IL_001f: brtrue.s IL_0028
IL_0021: ldstr "false"
IL_0026: br.s IL_002d
IL_0028: ldstr "true"
IL_002d: nop
IL_002e: ldstr "; expected: false"
IL_0033: call string string::Concat(string, string, string)
IL_0038: call void class [mscorlib]System.Console::WriteLine(string)
As a result of this, program compiled with mono csharp compiler produces
totally unexpected results.
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 3.8-2-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages mono-mcs depends on:
ii libc6 2.17-3
ii libmono-corlib4.5-cil 3.0.6+dfsg2-4
ii libmono-microsoft-csharp4.0-cil 3.0.6+dfsg2-4
ii libmono-system-core4.0-cil 3.0.6+dfsg2-4
ii libmono-system-xml4.0-cil 3.0.6+dfsg2-4
ii libmono-system4.0-cil 3.0.6+dfsg2-4
ii mono-runtime 3.0.6+dfsg2-4
Versions of packages mono-mcs recommends:
ii pkg-config 0.26-1
mono-mcs suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Version: 3.2.3+dfsg-5
On 2013-12-24 16:54:41, Weirdan wrote:
> Control: tags -1 help
>
> Upstream says it's fixed but does not specify the version the fix is
> available in. Can someone test this in experimental?
>
>
> On Sun, Jun 9, 2013 at 4:51 AM, Weirdan <[email protected]> wrote:
>
> > Control: tags -1 upstream
> > Control: forwarded -1 https://bugzilla.xamarin.com/show_bug.cgi?id=12608
> >
> >
> > Reported upstream: https://bugzilla.xamarin.com/show_bug.cgi?id=12608
I just tried it with the version in experimental and it is fixed there.
It gives the expected output and the disassembled code looks reasonable.
Hence I'm closing the bug and mark it fixed with the version currently
found in experimental.
Regards
--
Sebastian Ramacher
signature.asc
Description: Digital signature
--- End Message ---