{"action":"closed","number":2027,"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/2027","id":36858310,"html_url":"https://github.com/chapel-lang/chapel/pull/2027","diff_url":"https://github.com/chapel-lang/chapel/pull/2027.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/2027.patch","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/2027","number":2027,"state":"closed","locked":false,"title":"Fix lowering of ForLoop statements","user":{"login":"hildeth","id":7853742,"avatar_url":"https://avatars.githubusercontent.com/u/7853742?v=3","gravatar_id":"","url":"https://api.github.com/users/hildeth","html_url":"https://github.com/hildeth","followers_url":"https://api.github.com/users/hildeth/followers","following_url":"https://api.github.com/users/hildeth/following{/other_user}","gists_url":"https://api.github.com/users/hildeth/gists{/gist_id}","starred_url":"https://api.github.com/users/hildeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hildeth/subscriptions","organizations_url":"https://api.github.com/users/hildeth/orgs","repos_url":"https://api.github.com/users/hildeth/repos","events_url":"https://api.github.com/users/hildeth/events{/privacy}","received_events_url":"https://api.github.com/users/hildeth/received_events","type":"User","site_admin":false},"body":"This is a long-standing logical error in the code for creating the zip1 and zip3 functions from a ForLoop [block] statement.  The error was exposed by valgrind: it complains for some instances of zip1 and zip3 that the referenced \"value\" field is never initialized.\r\n\r\nThe failing tests included:\r\n```\r\n   classes/bradc/arrayInClass/arrayInClassRecord\r\n   io/tzakian/recordReader/test\r\n   modules/standard/Path/lydia/realpath/fileNotValid\r\n   regexp/ferguson/rechan\r\n   studies/beer/bradc/beer-promoted-infer-explicit\r\n```\r\n(these must be run with -valgrindexe to get the error to surface).\r\n\r\nIn the failing case, iterator lowering was effectively creating the code::\r\n```C\r\n   if (ic->value) then ic->more = 1 else ic->more = 0;\r\n```\r\nBut in the code I examined the rest of the lowered ForLoop construct never set the ic->value field to anything.  The error message from valgrind is quite valid.\r\n\r\nThe question remained, what should go there instead?  I assume that the intended semantics of::\r\n```\r\n   for e in <expr> do <stmt>\r\n```\r\nis that e takes on the values represented by <expr>.  It appears that <expr> is converted internally into an iterator, so the termination test in the lowering of a ForLoop (computed as ic->more by zip1() and zip3()) should not test the *value* of ic at all.  It should instead test the *more* field of the implicit contained iterator.  The code I inserted does this::\r\n```C\r\n   if (ic->iterator->more) then ic->more = 1 else ic->more = 0;\r\n```\r\nwhich I assume to be the intended semantics.  This guess passes a full regression test run, so it can't be too far from the truth.\r\n\r\nTODO: The above statement can probably be simplified to::\r\n```C\r\n   ic->more = ic->iterator->more;\r\n```\r\nSince the types of all _more_ fields are the same.","created_at":"2015-06-03T17:43:47Z","updated_at":"2015-06-03T19:06:37Z","closed_at":"2015-06-03T19:06:37Z","merged_at":"2015-06-03T19:06:37Z","merge_commit_sha":"46afdd229c96017a3f1af3e483ca6972a995290f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/2027/commits","review_comments_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/2027/comments","review_comment_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/2027/comments","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/d3ded26f07fec6b842e7a96568cf78c1651e081d","head":{"label":"hildeth:fixForLoopLowering","ref":"fixForLoopLowering","sha":"d3ded26f07fec6b842e7a96568cf78c1651e081d","user":{"login":"hildeth","id":7853742,"avatar_url":"https://avatars.githubusercontent.com/u/7853742?v=3","gravatar_id":"","url":"https://api.github.com/users/hildeth","html_url":"https://github.com/hildeth","followers_url":"https://api.github.com/users/hildeth/followers","following_url":"https://api.github.com/users/hildeth/following{/other_user}","gists_url":"https://api.github.com/users/hildeth/gists{/gist_id}","starred_url":"https://api.github.com/users/hildeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hildeth/subscriptions","organizations_url":"https://api.github.com/users/hildeth/orgs","repos_url":"https://api.github.com/users/hildeth/repos","events_url":"https://api.github.com/users/hildeth/events{/privacy}","received_events_url":"https://api.github.com/users/hildeth/received_events","type":"User","site_admin":false},"repo":{"id":21909706,"name":"chapel","full_name":"hildeth/chapel","owner":{"login":"hildeth","id":7853742,"avatar_url":"https://avatars.githubusercontent.com/u/7853742?v=3","gravatar_id":"","url":"https://api.github.com/users/hildeth","html_url":"https://github.com/hildeth","followers_url":"https://api.github.com/users/hildeth/followers","following_url":"https://api.github.com/users/hildeth/following{/other_user}","gists_url":"https://api.github.com/users/hildeth/gists{/gist_id}","starred_url":"https://api.github.com/users/hildeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hildeth/subscriptions","organizations_url":"https://api.github.com/users/hildeth/orgs","repos_url":"https://api.github.com/users/hildeth/repos","events_url":"https://api.github.com/users/hildeth/events{/privacy}","received_events_url":"https://api.github.com/users/hildeth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hildeth/chapel","description":"a Productive Parallel Programming Language","fork":true,"url":"https://api.github.com/repos/hildeth/chapel","forks_url":"https://api.github.com/repos/hildeth/chapel/forks","keys_url":"https://api.github.com/repos/hildeth/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hildeth/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hildeth/chapel/teams","hooks_url":"https://api.github.com/repos/hildeth/chapel/hooks","issue_events_url":"https://api.github.com/repos/hildeth/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/hildeth/chapel/events","assignees_url":"https://api.github.com/repos/hildeth/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/hildeth/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/hildeth/chapel/tags","blobs_url":"https://api.github.com/repos/hildeth/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hildeth/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hildeth/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/hildeth/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hildeth/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/hildeth/chapel/languages","stargazers_url":"https://api.github.com/repos/hildeth/chapel/stargazers","contributors_url":"https://api.github.com/repos/hildeth/chapel/contributors","subscribers_url":"https://api.github.com/repos/hildeth/chapel/subscribers","subscription_url":"https://api.github.com/repos/hildeth/chapel/subscription","commits_url":"https://api.github.com/repos/hildeth/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/hildeth/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/hildeth/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/hildeth/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/hildeth/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/hildeth/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hildeth/chapel/merges","archive_url":"https://api.github.com/repos/hildeth/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hildeth/chapel/downloads","issues_url":"https://api.github.com/repos/hildeth/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/hildeth/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/hildeth/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/hildeth/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hildeth/chapel/labels{/name}","releases_url":"https://api.github.com/repos/hildeth/chapel/releases{/id}","created_at":"2014-07-16T17:09:45Z","updated_at":"2015-05-08T18:29:17Z","pushed_at":"2015-06-03T18:18:23Z","git_url":"git://github.com/hildeth/chapel.git","ssh_url":"git@github.com:hildeth/chapel.git","clone_url":"https://github.com/hildeth/chapel.git","svn_url":"https://github.com/hildeth/chapel","homepage":"http://chapel.cray.com/","size":289184,"stargazers_count":1,"watchers_count":1,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"chapel-lang:string-as-rec","ref":"string-as-rec","sha":"fb0a91e418d4911b2585fe2ae20768a8059e20c2","user":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":21663285,"name":"chapel","full_name":"chapel-lang/chapel","owner":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chapel-lang/chapel","description":"a Productive Parallel Programming Language","fork":false,"url":"https://api.github.com/repos/chapel-lang/chapel","forks_url":"https://api.github.com/repos/chapel-lang/chapel/forks","keys_url":"https://api.github.com/repos/chapel-lang/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapel-lang/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapel-lang/chapel/teams","hooks_url":"https://api.github.com/repos/chapel-lang/chapel/hooks","issue_events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/chapel-lang/chapel/events","assignees_url":"https://api.github.com/repos/chapel-lang/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/chapel-lang/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/chapel-lang/chapel/tags","blobs_url":"https://api.github.com/repos/chapel-lang/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapel-lang/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapel-lang/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapel-lang/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/chapel-lang/chapel/languages","stargazers_url":"https://api.github.com/repos/chapel-lang/chapel/stargazers","contributors_url":"https://api.github.com/repos/chapel-lang/chapel/contributors","subscribers_url":"https://api.github.com/repos/chapel-lang/chapel/subscribers","subscription_url":"https://api.github.com/repos/chapel-lang/chapel/subscription","commits_url":"https://api.github.com/repos/chapel-lang/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapel-lang/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/chapel-lang/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/chapel-lang/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapel-lang/chapel/merges","archive_url":"https://api.github.com/repos/chapel-lang/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapel-lang/chapel/downloads","issues_url":"https://api.github.com/repos/chapel-lang/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/chapel-lang/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/chapel-lang/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/chapel-lang/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapel-lang/chapel/labels{/name}","releases_url":"https://api.github.com/repos/chapel-lang/chapel/releases{/id}","created_at":"2014-07-09T18:15:54Z","updated_at":"2015-06-02T21:27:15Z","pushed_at":"2015-06-03T19:06:37Z","git_url":"git://github.com/chapel-lang/chapel.git","ssh_url":"git@github.com:chapel-lang/chapel.git","clone_url":"https://github.com/chapel-lang/chapel.git","svn_url":"https://github.com/chapel-lang/chapel","homepage":"http://chapel.cray.com/","size":435193,"stargazers_count":114,"watchers_count":114,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":10,"forks":43,"open_issues":10,"watchers":114,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/2027"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/2027"},"issue":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/2027"},"comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/2027/comments"},"review_comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/2027/comments"},"review_comment":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/2027/commits"},"statuses":{"href":"https://api.github.com/repos/chapel-lang/chapel/statuses/d3ded26f07fec6b842e7a96568cf78c1651e081d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"hildeth","id":7853742,"avatar_url":"https://avatars.githubusercontent.com/u/7853742?v=3","gravatar_id":"","url":"https://api.github.com/users/hildeth","html_url":"https://github.com/hildeth","followers_url":"https://api.github.com/users/hildeth/followers","following_url":"https://api.github.com/users/hildeth/following{/other_user}","gists_url":"https://api.github.com/users/hildeth/gists{/gist_id}","starred_url":"https://api.github.com/users/hildeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hildeth/subscriptions","organizations_url":"https://api.github.com/users/hildeth/orgs","repos_url":"https://api.github.com/users/hildeth/repos","events_url":"https://api.github.com/users/hildeth/events{/privacy}","received_events_url":"https://api.github.com/users/hildeth/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":3,"additions":14,"deletions":6,"changed_files":1}}