{"action":"closed","issue":{"url":"https://api.github.com/repos/marekjm/viuavm/issues/76","labels_url":"https://api.github.com/repos/marekjm/viuavm/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/marekjm/viuavm/issues/76/comments","events_url":"https://api.github.com/repos/marekjm/viuavm/issues/76/events","html_url":"https://github.com/marekjm/viuavm/issues/76","id":95903222,"number":76,"title":"Infinite loop detection","user":{"login":"marekjm","id":2565699,"avatar_url":"https://avatars.githubusercontent.com/u/2565699?v=3","gravatar_id":"","url":"https://api.github.com/users/marekjm","html_url":"https://github.com/marekjm","followers_url":"https://api.github.com/users/marekjm/followers","following_url":"https://api.github.com/users/marekjm/following{/other_user}","gists_url":"https://api.github.com/users/marekjm/gists{/gist_id}","starred_url":"https://api.github.com/users/marekjm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marekjm/subscriptions","organizations_url":"https://api.github.com/users/marekjm/orgs","repos_url":"https://api.github.com/users/marekjm/repos","events_url":"https://api.github.com/users/marekjm/events{/privacy}","received_events_url":"https://api.github.com/users/marekjm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/marekjm/viuavm/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/marekjm/viuavm/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/marekjm/viuavm/milestones/1","html_url":"https://github.com/marekjm/viuavm/milestones/Release%201.0","labels_url":"https://api.github.com/repos/marekjm/viuavm/milestones/1/labels","id":933805,"number":1,"title":"Release 1.0","description":"First useable release.","creator":{"login":"marekjm","id":2565699,"avatar_url":"https://avatars.githubusercontent.com/u/2565699?v=3","gravatar_id":"","url":"https://api.github.com/users/marekjm","html_url":"https://github.com/marekjm","followers_url":"https://api.github.com/users/marekjm/followers","following_url":"https://api.github.com/users/marekjm/following{/other_user}","gists_url":"https://api.github.com/users/marekjm/gists{/gist_id}","starred_url":"https://api.github.com/users/marekjm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marekjm/subscriptions","organizations_url":"https://api.github.com/users/marekjm/orgs","repos_url":"https://api.github.com/users/marekjm/repos","events_url":"https://api.github.com/users/marekjm/events{/privacy}","received_events_url":"https://api.github.com/users/marekjm/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":5,"state":"open","created_at":"2015-01-13T17:37:30Z","updated_at":"2015-09-06T11:13:11Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-07-19T10:06:55Z","updated_at":"2015-09-06T11:13:11Z","closed_at":"2015-09-06T11:13:11Z","body":"Currently, machine provides only a limited form of instruction-level protection from infinite loops and one that only guards against `jump` instructions going directly to themselves.\r\n\r\nHowever, this is insufficient and machine should employ more advanced safeguards. Example cases include:\r\n\r\n**backjump with no way of branching out**\r\n\r\n```\r\n.mark: here\r\nistore 1 42\r\nprint 1\r\njump here\r\n```\r\n\r\n**infinite fallthrough** (as exposed by #73):\r\n\r\n```\r\n.function: one\r\n    istore 1 42\r\n    print 1\r\n    izero 0\r\n    ; no end here creates infinite loop\r\n.end\r\n\r\n.function: main\r\n    frame 0 2\r\n    call one\r\n    izero 0\r\n    end\r\n.end\r\n```\r\n\r\nGood news is that overhead from infinite loop detection could be lowered by performing more strict compile-time code checking (some infinite backjumps could be easily found by code analysis)."}}