{"action":"created","issue":{"url":"https://api.github.com/repos/oridb/mc/issues/83","repository_url":"https://api.github.com/repos/oridb/mc","labels_url":"https://api.github.com/repos/oridb/mc/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/oridb/mc/issues/83/comments","events_url":"https://api.github.com/repos/oridb/mc/issues/83/events","html_url":"https://github.com/oridb/mc/issues/83","id":133402232,"number":83,"title":"Miscompilation with union args","user":{"login":"andrewchambers","id":962885,"avatar_url":"https://avatars.githubusercontent.com/u/962885?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewchambers","html_url":"https://github.com/andrewchambers","followers_url":"https://api.github.com/users/andrewchambers/followers","following_url":"https://api.github.com/users/andrewchambers/following{/other_user}","gists_url":"https://api.github.com/users/andrewchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewchambers/subscriptions","organizations_url":"https://api.github.com/users/andrewchambers/orgs","repos_url":"https://api.github.com/users/andrewchambers/repos","events_url":"https://api.github.com/users/andrewchambers/events{/privacy}","received_events_url":"https://api.github.com/users/andrewchambers/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-13T05:42:35Z","updated_at":"2016-02-14T21:48:06Z","closed_at":"2016-02-14T07:25:22Z","body":"```\r\nuse std\r\n\r\ntype msg = union\r\n\t`Tversion\ttversion\r\n\t`Twalk\ttwalk\r\n;;\r\n\r\ntype tversion = struct\r\n\ttag\t: uint16\r\n;;\r\ntype twalk = struct\r\n\twnames\t: byte[:][16]\r\n;;\r\n\r\nconst wrmsg = {buf, m\r\n\tvar ret\r\n\r\n\tret = buf[:4]\r\n\tstd.put(\"beforeret:\\n\")\r\n\tstd.put(\"{r}\\n\", ret)\r\n\t-> ret\r\n}\r\nconst main = {\r\n\tvar buf = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\r\n\tvar buf2\r\n\t\r\n\tfor var i = 0; i < buf.len; i++\r\n\t\tbuf[i] = 0\r\n\t;;\r\n\tbuf2 = wrmsg(buf[:], `Tversion [.tag=6])\r\n\tstd.put(\"afterret:\\n\")\r\n\tstd.put(\"{r}\\n\", buf2)\r\n}\r\n```\r\n```\r\nac@black:~/Desktop/bug$ mbld -b bug bug.myr  && ./bug\r\nbug...\r\n\t6m\tbug.myr \r\n\tld\t-o bug /usr/local/lib/myr/_myrrt.o bug.o -L/usr/local/lib/myr -lstd -lsys \r\nbeforeret:\r\n[0, 0, 0, 0]\r\nafterret:\r\nSegmentation fault (core dumped)\r\n```\r\n\r\nSpecial note: the {r} formatting specifier is being ignored, corrupted that param too perhaps?"},"comment":{"url":"https://api.github.com/repos/oridb/mc/issues/comments/183987860","html_url":"https://github.com/oridb/mc/issues/83#issuecomment-183987860","issue_url":"https://api.github.com/repos/oridb/mc/issues/83","id":183987860,"user":{"login":"andrewchambers","id":962885,"avatar_url":"https://avatars.githubusercontent.com/u/962885?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewchambers","html_url":"https://github.com/andrewchambers","followers_url":"https://api.github.com/users/andrewchambers/followers","following_url":"https://api.github.com/users/andrewchambers/following{/other_user}","gists_url":"https://api.github.com/users/andrewchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewchambers/subscriptions","organizations_url":"https://api.github.com/users/andrewchambers/orgs","repos_url":"https://api.github.com/users/andrewchambers/repos","events_url":"https://api.github.com/users/andrewchambers/events{/privacy}","received_events_url":"https://api.github.com/users/andrewchambers/received_events","type":"User","site_admin":false},"created_at":"2016-02-14T21:48:06Z","updated_at":"2016-02-14T21:48:06Z","body":"Are we going to go back and investigate the reg allocator? or ignore it for now."}}