{"action":"created","issue":{"url":"https://api.github.com/repos/tromp/equihash/issues/15","repository_url":"https://api.github.com/repos/tromp/equihash","labels_url":"https://api.github.com/repos/tromp/equihash/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/tromp/equihash/issues/15/comments","events_url":"https://api.github.com/repos/tromp/equihash/issues/15/events","html_url":"https://github.com/tromp/equihash/issues/15","id":321754234,"number":15,"title":"Why isn't this array access out of bound?","user":{"login":"sebastianst","id":2607372,"avatar_url":"https://avatars1.githubusercontent.com/u/2607372?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastianst","html_url":"https://github.com/sebastianst","followers_url":"https://api.github.com/users/sebastianst/followers","following_url":"https://api.github.com/users/sebastianst/following{/other_user}","gists_url":"https://api.github.com/users/sebastianst/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianst/subscriptions","organizations_url":"https://api.github.com/users/sebastianst/orgs","repos_url":"https://api.github.com/users/sebastianst/repos","events_url":"https://api.github.com/users/sebastianst/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-09T22:59:26Z","updated_at":"2018-05-10T07:47:49Z","closed_at":null,"author_association":"NONE","body":"I'm trying to understand some part of the solver and am stuck here.\r\nSee\r\nhttps://github.com/tromp/equihash/blob/39a91772abc503ace4b5ae5e1af1fde482eb077b/equi_miner.h#L908\r\n`digit4()` and `digit7()` both access `slot1->bytes[4]`, but the union `slot1`, which is a `htunit`, holds at `bytes` a   `uchar[sizeof(tree_t)]` presentation. `tree_t` is either `u16` or `u32`, so `sizeof(tree_t)` is either 2 or 4. How can the access to `bytes[4]` not be out of the array's bound?"},"comment":{"url":"https://api.github.com/repos/tromp/equihash/issues/comments/387979544","html_url":"https://github.com/tromp/equihash/issues/15#issuecomment-387979544","issue_url":"https://api.github.com/repos/tromp/equihash/issues/15","id":387979544,"user":{"login":"tromp","id":2347227,"avatar_url":"https://avatars2.githubusercontent.com/u/2347227?v=4","gravatar_id":"","url":"https://api.github.com/users/tromp","html_url":"https://github.com/tromp","followers_url":"https://api.github.com/users/tromp/followers","following_url":"https://api.github.com/users/tromp/following{/other_user}","gists_url":"https://api.github.com/users/tromp/gists{/gist_id}","starred_url":"https://api.github.com/users/tromp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tromp/subscriptions","organizations_url":"https://api.github.com/users/tromp/orgs","repos_url":"https://api.github.com/users/tromp/repos","events_url":"https://api.github.com/users/tromp/events{/privacy}","received_events_url":"https://api.github.com/users/tromp/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T07:47:49Z","updated_at":"2018-05-10T07:47:49Z","author_association":"OWNER","body":"Slots are in fact larger than a single htunit:\r\n\r\ntypedef htunit slot0[HASHWORDS0+1];\r\ntypedef htunit slot1[HASHWORDS1+1];\r\n\r\nSo the bytes[] in one htunit can extend into subsequent htunits."}}
{"actor":{"display_login":"tromp"}}