{"action":"closed","issue":{"url":"https://api.github.com/repos/ethereum/solidity/issues/2916","repository_url":"https://api.github.com/repos/ethereum/solidity","labels_url":"https://api.github.com/repos/ethereum/solidity/issues/2916/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/2916/comments","events_url":"https://api.github.com/repos/ethereum/solidity/issues/2916/events","html_url":"https://github.com/ethereum/solidity/issues/2916","id":258294728,"node_id":"MDU6SXNzdWUyNTgyOTQ3Mjg=","number":2916,"title":"Undescriptive exception is thrown when stack underflows during --assemble","user":{"login":"ritave","id":1614945,"node_id":"MDQ6VXNlcjE2MTQ5NDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1614945?v=4","gravatar_id":"","url":"https://api.github.com/users/ritave","html_url":"https://github.com/ritave","followers_url":"https://api.github.com/users/ritave/followers","following_url":"https://api.github.com/users/ritave/following{/other_user}","gists_url":"https://api.github.com/users/ritave/gists{/gist_id}","starred_url":"https://api.github.com/users/ritave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritave/subscriptions","organizations_url":"https://api.github.com/users/ritave/orgs","repos_url":"https://api.github.com/users/ritave/repos","events_url":"https://api.github.com/users/ritave/events{/privacy}","received_events_url":"https://api.github.com/users/ritave/received_events","type":"User","site_admin":false},"labels":[{"id":249074435,"node_id":"MDU6TGFiZWwyNDkwNzQ0MzU=","url":"https://api.github.com/repos/ethereum/solidity/labels/bug%20:bug:","name":"bug :bug:","color":"fc1313","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-17T10:50:20Z","updated_at":"2018-08-03T17:30:34Z","closed_at":"2018-08-03T17:30:34Z","author_association":"NONE","body":"I was writting standalone assembly and had a bug in my code, with a minimal reproduction being:\r\n```\r\n{\r\n    0x1\r\n    jumpi my_tag\r\n    my_tag:\r\n    stop\r\n}\r\n```\r\nwhich should be\r\n```\r\n{\r\n    0x1\r\n    my_tag\r\n    jumpi\r\n    my_tag:\r\n    stop\r\n}\r\n\r\n```\r\ninstead.\r\nSolc then threw out an error without any explanation:\r\n```\r\nPretty printed source:\r\n{\r\n    0x1\r\n    jumpi\r\n    my_tag\r\n    my_tag:\r\n    stop\r\n}\r\nException while assembling: D:\\Libraries\\Documents\\Praca\\solidity\\libevmasm\\Assembly.cpp(323): Throw in function const class dev::eth::AssemblyItem &__cdecl dev::eth::Assembly::append(const class dev::eth::AssemblyItem &)\r\nDynamic exception type: class boost::exception_detail::clone_impl<struct dev::eth::AssemblyException>\r\nstd::exception::what:\r\n[struct dev::tag_comment * __ptr64] =\r\n```\r\n\r\nAssembly.cpp calculates the stack depth constantly, and on underflow throws an undescriptive exception   in [Assembly.cpp:323](https://github.com/ethereum/solidity/blob/develop/libevmasm/Assembly.cpp#L323)\r\n\r\nI would expect the error to be ignored (I'm doing raw jumps, safety is up-to me), or a warning issued.\r\n\r\nWhile we're here I believe that stack depth calculations shouldn't be enforced and be more-or-less optional (so you can use `:=` variables). That's because if I'm writing raw manual assembly, the flow and stack-depth might really not follow the expectations of blocks and empty stacks after each one and I might be jumping around the control flow.\r\n\r\nAdditional info:\r\nSolidity commit hash which I used:\r\n```a0d171722a211720773aae0ded8a80991d44ba9d```"}}
{"actor":{"display_login":"christianparpart"}}