{"action":"created","issue":{"url":"https://api.github.com/repos/andrewrk/zig/issues/177","repository_url":"https://api.github.com/repos/andrewrk/zig","labels_url":"https://api.github.com/repos/andrewrk/zig/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/andrewrk/zig/issues/177/comments","events_url":"https://api.github.com/repos/andrewrk/zig/issues/177/events","html_url":"https://github.com/andrewrk/zig/pull/177","id":173887629,"number":177,"title":"fix uninitialized variables","user":{"login":"bryongloden","id":3155274,"avatar_url":"https://avatars.githubusercontent.com/u/3155274?v=3","gravatar_id":"","url":"https://api.github.com/users/bryongloden","html_url":"https://github.com/bryongloden","followers_url":"https://api.github.com/users/bryongloden/followers","following_url":"https://api.github.com/users/bryongloden/following{/other_user}","gists_url":"https://api.github.com/users/bryongloden/gists{/gist_id}","starred_url":"https://api.github.com/users/bryongloden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryongloden/subscriptions","organizations_url":"https://api.github.com/users/bryongloden/orgs","repos_url":"https://api.github.com/users/bryongloden/repos","events_url":"https://api.github.com/users/bryongloden/events{/privacy}","received_events_url":"https://api.github.com/users/bryongloden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-29T22:25:27Z","updated_at":"2016-08-29T22:40:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/andrewrk/zig/pulls/177","html_url":"https://github.com/andrewrk/zig/pull/177","diff_url":"https://github.com/andrewrk/zig/pull/177.diff","patch_url":"https://github.com/andrewrk/zig/pull/177.patch"},"body":"On line number 330 of ‘[tokenizer.cpp](https://github.com/andrewrk/zig/blob/master/src/tokenizer.cpp#L330)’, ‘`significand_bits`’ and ‘`exponent_bits`’ may be accessed without an initialized value. It's always good to initialize variables, because if we try to access a value before it gets assigned any actual (non-garbage) value, then it results in undefined behavior.\r\n\r\nFound by https://github.com/bryongloden/cppcheck"},"comment":{"url":"https://api.github.com/repos/andrewrk/zig/issues/comments/243279429","html_url":"https://github.com/andrewrk/zig/pull/177#issuecomment-243279429","issue_url":"https://api.github.com/repos/andrewrk/zig/issues/177","id":243279429,"user":{"login":"andrewrk","id":106511,"avatar_url":"https://avatars.githubusercontent.com/u/106511?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewrk","html_url":"https://github.com/andrewrk","followers_url":"https://api.github.com/users/andrewrk/followers","following_url":"https://api.github.com/users/andrewrk/following{/other_user}","gists_url":"https://api.github.com/users/andrewrk/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewrk/subscriptions","organizations_url":"https://api.github.com/users/andrewrk/orgs","repos_url":"https://api.github.com/users/andrewrk/repos","events_url":"https://api.github.com/users/andrewrk/events{/privacy}","received_events_url":"https://api.github.com/users/andrewrk/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T22:40:03Z","updated_at":"2016-08-29T22:40:03Z","body":"Thank you for this contribution. Do you have some source code that activates the undefined behavior here?\r\n\r\nI'm not convinced there actually is undefined behavior here - and assigning 0 to variables can actually hide bugs. Right now if you run zig in valgrind, and undefined behavior is activated, valgrind will catch it. However, if we initialize these variables to 0, 0 may be an incorrect value, and incorrect behavior will happen which valgrind cannot catch."}}
{"actor":{"display_login":"andrewrk"}}