{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/3834","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/3834/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/3834/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/3834/events","html_url":"https://github.com/dotnet/coreclr/issues/3834","id":142148979,"number":3834,"title":"Dynamic Code Generation accepts invalid Mul (?)","user":{"login":"damageboy","id":125730,"avatar_url":"https://avatars.githubusercontent.com/u/125730?v=3","gravatar_id":"","url":"https://api.github.com/users/damageboy","html_url":"https://github.com/damageboy","followers_url":"https://api.github.com/users/damageboy/followers","following_url":"https://api.github.com/users/damageboy/following{/other_user}","gists_url":"https://api.github.com/users/damageboy/gists{/gist_id}","starred_url":"https://api.github.com/users/damageboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damageboy/subscriptions","organizations_url":"https://api.github.com/users/damageboy/orgs","repos_url":"https://api.github.com/users/damageboy/repos","events_url":"https://api.github.com/users/damageboy/events{/privacy}","received_events_url":"https://api.github.com/users/damageboy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/coreclr/labels/CodeGen","name":"CodeGen","color":"d4c5f9"},{"url":"https://api.github.com/repos/dotnet/coreclr/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/5","html_url":"https://github.com/dotnet/coreclr/milestones/Future","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/5/labels","id":1328081,"number":5,"title":"Future","description":"Milestone tracking the issues that have been triaged for after 1.0.0-rtm","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":380,"closed_issues":68,"state":"open","created_at":"2015-09-29T00:26:07Z","updated_at":"2016-03-24T01:09:11Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-03-20T10:34:51Z","updated_at":"2016-03-24T01:09:31Z","closed_at":null,"body":"Hi,\r\nI originally opened this bug for the mono team for what I thought was an error in Mono:\r\nhttps://bugzilla.xamarin.com/show_bug.cgi?id=39775\r\n\r\nThe issue seems to be the DynamicMethod.CreateDelegate will accept the following stream of MSIL\r\n(This is obviously pseudo code, here for clarity):\r\n\r\n```\r\n.locals init (\r\n\t[0] int32,\r\n\t[1] float64,\r\n)\r\nIL_0000: ldloc.0  // This is of type int32\r\nIL_0001: ldloc.1 // This is of type Double\r\nIL_0002: mul\r\n```\r\n\r\nAnd happily compile it.\r\n\r\nHere is a sample program the compiles cleanly in CoreCLR / MS.NET (Note this is also a bug in the \"standard .NET\" distribution):\r\nhttps://gist.github.com/damageboy/887a87b14bc3eb5f2212\r\n\r\nThe CIL spec clearly disallows this:\r\nhttp://www.ecma-international.org/publications/files/ECMA-ST/ECMA-335.pdf\r\n(Page 302, Table III.2: Binary Numeric Operations)\r\n\r\nI've copy-pasted the table for reference:\r\n![image](https://cloud.githubusercontent.com/assets/125730/13903851/93474c74-ee93-11e5-8477-158464c02551.png)\r\n\r\nAs you can see, any operation between different types, is generally disallowed according to the spec...\r\n\r\nI've checked the program compiled and runs to completion on both MS.NET 4.6.x and CoreCLR `1.0.0-beta-001598`.\r\n\r\nThis is of course undesired behavior as the program should (?) report invalid MSIL being constructed, as other illegal MSIL streams often do in DynamicMethods..."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/200603892","html_url":"https://github.com/dotnet/coreclr/issues/3834#issuecomment-200603892","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/3834","id":200603892,"user":{"login":"RussKeldorph","id":15160879,"avatar_url":"https://avatars.githubusercontent.com/u/15160879?v=3","gravatar_id":"","url":"https://api.github.com/users/RussKeldorph","html_url":"https://github.com/RussKeldorph","followers_url":"https://api.github.com/users/RussKeldorph/followers","following_url":"https://api.github.com/users/RussKeldorph/following{/other_user}","gists_url":"https://api.github.com/users/RussKeldorph/gists{/gist_id}","starred_url":"https://api.github.com/users/RussKeldorph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RussKeldorph/subscriptions","organizations_url":"https://api.github.com/users/RussKeldorph/orgs","repos_url":"https://api.github.com/users/RussKeldorph/repos","events_url":"https://api.github.com/users/RussKeldorph/events{/privacy}","received_events_url":"https://api.github.com/users/RussKeldorph/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T01:09:31Z","updated_at":"2016-03-24T01:09:31Z","body":"@dotnet/jit-contrib "}}