{"action":"created","issue":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/232","repository_url":"https://api.github.com/repos/supercollider/supercollider","labels_url":"https://api.github.com/repos/supercollider/supercollider/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/supercollider/supercollider/issues/232/comments","events_url":"https://api.github.com/repos/supercollider/supercollider/issues/232/events","html_url":"https://github.com/supercollider/supercollider/issues/232","id":4441435,"node_id":"MDU6SXNzdWU0NDQxNDM1","number":232,"title":"'try' in a loop doesn't unwind all the stack items it should","user":{"login":"jleben","id":155048,"node_id":"MDQ6VXNlcjE1NTA0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/155048?v=4","gravatar_id":"","url":"https://api.github.com/users/jleben","html_url":"https://github.com/jleben","followers_url":"https://api.github.com/users/jleben/followers","following_url":"https://api.github.com/users/jleben/following{/other_user}","gists_url":"https://api.github.com/users/jleben/gists{/gist_id}","starred_url":"https://api.github.com/users/jleben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleben/subscriptions","organizations_url":"https://api.github.com/users/jleben/orgs","repos_url":"https://api.github.com/users/jleben/repos","events_url":"https://api.github.com/users/jleben/events{/privacy}","received_events_url":"https://api.github.com/users/jleben/received_events","type":"User","site_admin":false},"labels":[{"id":4413795,"node_id":"MDU6TGFiZWw0NDEzNzk1","url":"https://api.github.com/repos/supercollider/supercollider/labels/bug","name":"bug","color":"fc2929","default":true},{"id":4477094,"node_id":"MDU6TGFiZWw0NDc3MDk0","url":"https://api.github.com/repos/supercollider/supercollider/labels/comp:%20sclang","name":"comp: sclang","color":"CFFF7D","default":false}],"state":"open","locked":false,"assignee":{"login":"brianlheim","id":15369640,"node_id":"MDQ6VXNlcjE1MzY5NjQw","avatar_url":"https://avatars3.githubusercontent.com/u/15369640?v=4","gravatar_id":"","url":"https://api.github.com/users/brianlheim","html_url":"https://github.com/brianlheim","followers_url":"https://api.github.com/users/brianlheim/followers","following_url":"https://api.github.com/users/brianlheim/following{/other_user}","gists_url":"https://api.github.com/users/brianlheim/gists{/gist_id}","starred_url":"https://api.github.com/users/brianlheim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianlheim/subscriptions","organizations_url":"https://api.github.com/users/brianlheim/orgs","repos_url":"https://api.github.com/users/brianlheim/repos","events_url":"https://api.github.com/users/brianlheim/events{/privacy}","received_events_url":"https://api.github.com/users/brianlheim/received_events","type":"User","site_admin":false},"assignees":[{"login":"brianlheim","id":15369640,"node_id":"MDQ6VXNlcjE1MzY5NjQw","avatar_url":"https://avatars3.githubusercontent.com/u/15369640?v=4","gravatar_id":"","url":"https://api.github.com/users/brianlheim","html_url":"https://github.com/brianlheim","followers_url":"https://api.github.com/users/brianlheim/followers","following_url":"https://api.github.com/users/brianlheim/following{/other_user}","gists_url":"https://api.github.com/users/brianlheim/gists{/gist_id}","starred_url":"https://api.github.com/users/brianlheim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianlheim/subscriptions","organizations_url":"https://api.github.com/users/brianlheim/orgs","repos_url":"https://api.github.com/users/brianlheim/repos","events_url":"https://api.github.com/users/brianlheim/events{/privacy}","received_events_url":"https://api.github.com/users/brianlheim/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2012-05-06T05:48:32Z","updated_at":"2018-10-14T11:15:21Z","closed_at":null,"author_association":"MEMBER","body":"[Issue migrated from SourceForge | ID: 3472743 | Submitted by 'jamshark70']\n[http://sourceforge.net/support/tracker.php?aid=3472743]\n\n```\nx = [nil];\n\"%\\n\".postf(x.do({ |item|\ntry { max(1, x) == 2 }\n}));\n```\n\n\"try\" should swallow the error, and the postf call should print the value of x (the return from 'do'). Instead:\n\n```\nERROR: Message 'postf' not understood.\nRECEIVER:\nInstance of Array {    (0x48a1e78, gc=E0, fmt=01, flg=00, set=02)\n  indexed slots [0]\n}\nARGS:\nInstance of Array {    (0x4831508, gc=E4, fmt=01, flg=00, set=02)\n  indexed slots [1]\n      0 : nil\n}\n```\n\nThe empty array that is the receiver of postf is postf's default argument -- see String.findMethod(\\postf).prototypeFrame.\n\nThe most likely explanation is that some function or method arguments get pushed onto the stack, and they are supposed to be removed before postf, but the combination of 'try' and the loop causes this not to happen.\n- It seems to occur only if 'try' is inside a loop.\n\n```\n\"%\\n\".postf(try { max(1, nil) == 1 })  // postf succeeds\n```\n- The bug does NOT occur if the method applied to the loop result has no arguments (receiver only). I discovered the issue when trying to do [\"First item\"] ++ anArray.select { try { ... } { false } }.\n\n```\n// 'size' succeeds\nx.select({ |item|\ntry { max(1, x) == 2 } { false }\n}).size\n```\n- The issue does not occur in a five month old revision. I bet the bug was there ever since try/protect were introduced. Since it wasn't discovered in several years (!) it's not likely to cause major headaches in 3.5, so don't waste time trying to fix this for 3.5.\n\nMarked for 3.6.\n"},"comment":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/comments/429617938","html_url":"https://github.com/supercollider/supercollider/issues/232#issuecomment-429617938","issue_url":"https://api.github.com/repos/supercollider/supercollider/issues/232","id":429617938,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTYxNzkzOA==","user":{"login":"olafklingt","id":3714501,"node_id":"MDQ6VXNlcjM3MTQ1MDE=","avatar_url":"https://avatars1.githubusercontent.com/u/3714501?v=4","gravatar_id":"","url":"https://api.github.com/users/olafklingt","html_url":"https://github.com/olafklingt","followers_url":"https://api.github.com/users/olafklingt/followers","following_url":"https://api.github.com/users/olafklingt/following{/other_user}","gists_url":"https://api.github.com/users/olafklingt/gists{/gist_id}","starred_url":"https://api.github.com/users/olafklingt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olafklingt/subscriptions","organizations_url":"https://api.github.com/users/olafklingt/orgs","repos_url":"https://api.github.com/users/olafklingt/repos","events_url":"https://api.github.com/users/olafklingt/events{/privacy}","received_events_url":"https://api.github.com/users/olafklingt/received_events","type":"User","site_admin":false},"created_at":"2018-10-14T11:15:21Z","updated_at":"2018-10-14T11:15:21Z","author_association":"CONTRIBUTOR","body":"I don't use try anymore because of i had problems because of this bug long ago. Now I am would like to know, is it possible to know under which conditions it is save to use try?"}}
{"actor":{"display_login":"olafklingt"}}