{"action":"created","issue":{"url":"https://api.github.com/repos/P-star/P-star/issues/47","labels_url":"https://api.github.com/repos/P-star/P-star/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/P-star/P-star/issues/47/comments","events_url":"https://api.github.com/repos/P-star/P-star/issues/47/events","html_url":"https://github.com/P-star/P-star/issues/47","id":97316860,"number":47,"title":"Foreach loop bug with arrays","user":{"login":"atlesn","id":800561,"avatar_url":"https://avatars.githubusercontent.com/u/800561?v=3","gravatar_id":"","url":"https://api.github.com/users/atlesn","html_url":"https://github.com/atlesn","followers_url":"https://api.github.com/users/atlesn/followers","following_url":"https://api.github.com/users/atlesn/following{/other_user}","gists_url":"https://api.github.com/users/atlesn/gists{/gist_id}","starred_url":"https://api.github.com/users/atlesn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlesn/subscriptions","organizations_url":"https://api.github.com/users/atlesn/orgs","repos_url":"https://api.github.com/users/atlesn/repos","events_url":"https://api.github.com/users/atlesn/events{/privacy}","received_events_url":"https://api.github.com/users/atlesn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-26T13:27:14Z","updated_at":"2015-09-22T19:18:48Z","closed_at":null,"body":"Foreach loop crashes when iterator arrays or hashes of zero length. Add check for zero-length arrays.\r\n\r\nProgram received signal SIGFPE, Arithmetic exception.\r\ndo_operator_recursive (final_result=0x61c7c0, exp_state=0x61d530, this=0x61e210) at value_array.cpp:155\r\n155\t\t\tint index_mod = index % max;\r\n\r\n#0  do_operator_recursive (final_result=0x61c7c0, exp_state=0x61d530, this=0x61e210) at value_array.cpp:155\r\n#1  wpl_value_array::do_operator_recursive (this=0x61e210, exp_state=0x61d530, final_result=0x61c7c0) at value_array.cpp:150\r\n#2  0x00007ffff7972107 in wpl_value_hash::do_operator (this=0x617790, exp_state=0x61d530, final_result=0x61c7c0, op=<optimized out>, lhs=<optimized out>, \r\n    rhs=<optimized out>) at value_hash.cpp:99\r\n#3  0x00007ffff79691e8 in wpl_value::do_fastop (this=0x617700, exp_state=<optimized out>, final_result=<optimized out>, op=0x7ffff7bd86a0) at value.cpp:118\r\n#4  0x00007ffff7972ce2 in wpl_value_unresolved_identifier::do_fastop (this=<optimized out>, exp_state=0x61d530, final_result=0x61c7c0, op=0x7ffff7bd86a0)\r\n    at value_unresolved.cpp:68\r\n#5  0x00007ffff794b975 in wpl_expression::run (this=<optimized out>, state=<optimized out>, final_result=<optimized out>) at expression.cpp:78\r\n#6  0x00007ffff795a6e3 in wpl_block_foreach::run (this=0x6139c0, state=<optimized out>, final_result=0x7fffffffe3b0) at block_foreach.cpp:56\r\n#7  0x00007ffff799a8eb in wpl_block_state::run_child (this=<optimized out>, child=0x6139e8, index=<optimized out>, final_result=0x7fffffffe3b0) at block_state.cpp:68\r\n#8  0x00007ffff795326c in wpl_block::run_children (this=0x60e6f0, block_state=0x6170d0, final_result=0x7fffffffe3b0) at block.cpp:71\r\n#9  0x00007ffff793ca6f in wpl_program::run (this=<optimized out>, io=...) at program.cpp:134\r\n#10 0x0000000000401e00 in main (argc=3, argv=0x7fffffffec58) at main.cpp:86\r\n"},"comment":{"url":"https://api.github.com/repos/P-star/P-star/issues/comments/142390582","html_url":"https://github.com/P-star/P-star/issues/47#issuecomment-142390582","issue_url":"https://api.github.com/repos/P-star/P-star/issues/47","id":142390582,"user":{"login":"atlesn","id":800561,"avatar_url":"https://avatars.githubusercontent.com/u/800561?v=3","gravatar_id":"","url":"https://api.github.com/users/atlesn","html_url":"https://github.com/atlesn","followers_url":"https://api.github.com/users/atlesn/followers","following_url":"https://api.github.com/users/atlesn/following{/other_user}","gists_url":"https://api.github.com/users/atlesn/gists{/gist_id}","starred_url":"https://api.github.com/users/atlesn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlesn/subscriptions","organizations_url":"https://api.github.com/users/atlesn/orgs","repos_url":"https://api.github.com/users/atlesn/repos","events_url":"https://api.github.com/users/atlesn/events{/privacy}","received_events_url":"https://api.github.com/users/atlesn/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T19:18:48Z","updated_at":"2015-09-22T19:18:48Z","body":"Still issue..."}}