[Mono-bugs] [Bug 381559] trivially simple reproduction of Invalid IL code bug ( anonymous methods + string concat)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 25 00:13:40 EDT 2008


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

User harinath at hurrynot.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=381559#c3


Raja Harinath <harinath at hurrynot.org> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |harinath at hurrynot.org




--- Comment #3 from Raja Harinath <harinath at hurrynot.org>  2008-04-24 22:13:40 MST ---
Thanks for the patch and analysis.  As you say the prepare_for_load protocol is
not particularly necessary in this scenario.

Unfortunately, this is a more insidous bug than that.

StringConcat is somewhat of a bad citizen here since it violates the (albeit
undocumented) assumptions of the prepare_for_load protocol.  Someone tried to
accomodate it when handling properties, but introduced a different bug instead.

---------------8<---------------
class Foo {
  static int id;
  int my_id = ++id;

  string s {
    get { return my_id.ToString (); }
    set { if (value != my_id + "A1B2") throw new System.Exception (); }
  }

  static void Main ()
  {
    (new Foo ()).s += "A" + 1 + "B" + 2;
  }
}
---------------8<---------------


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


More information about the mono-bugs mailing list