{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/22920913","id":22920913,"diff_hunk":"@@ -232,27 +232,71 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)\n \t\t}\n \t\tcase Location::EXTERNAL:\n \t\tcase Location::BARE:\n+\t\t\t_functionCall.getExpression().accept(*this);\n+\t\t\tappendExternalFunctionCall(function, arguments, function.getLocation() == Location::BARE);\n+\t\t\tbreak;\n+\t\tcase Location::CREATION:\n \t\t{\n-\t\t\tFunctionCallOptions options;\n-\t\t\toptions.bare = function.getLocation() == Location::BARE;\n-\t\t\toptions.obtainAddress = [&]() { _functionCall.getExpression().accept(*this); };\n-\t\t\tappendExternalFunctionCall(function, arguments, options);\n+\t\t\t_functionCall.getExpression().accept(*this);\n+\t\t\tsolAssert(!function.gasSet(), \"Gas limit set for contract creation.\");\n+\t\t\tsolAssert(function.getReturnParameterTypes().size() == 1, \"\");\n+\t\t\tContractDefinition const& contract = dynamic_cast<ContractType const&>(\n+\t\t\t\t\t\t\t*function.getReturnParameterTypes().front()).getContractDefinition();\n+\t\t\t// copy the contract's code into memory\n+\t\t\tbytes const& bytecode = m_context.getCompiledContract(contract);\n+\t\t\tm_context << u256(bytecode.size());\n+\t\t\t//@todo could be done by actually appending the Assembly, but then we probably need to compile\n+\t\t\t// multiple times. Will revisit once external fuctions are inlined.\n+\t\t\tm_context.appendData(bytecode);\n+\t\t\t//@todo copy to memory position 0, shift as soon as we use memory\n+\t\t\tm_context << u256(0) << eth::Instruction::CODECOPY;\n+\n+\t\t\tunsigned length = bytecode.size();\n+\t\t\tlength += appendArgumentCopyToMemory(function.getParameterTypes(), arguments, length);\n+\t\t\t// size, offset, endowment\n+\t\t\tm_context << u256(length) << u256(0);\n+\t\t\tif (function.valueSet())\n+\t\t\t\tm_context << eth::dupInstruction(3);\n+\t\t\telse\n+\t\t\t\tm_context << u256(0);\n+\t\t\tm_context << eth::Instruction::CREATE;\n+\t\t\tif (function.valueSet())\n+\t\t\t\tm_context << eth::swapInstruction(1) << eth::Instruction::POP;\n+\t\t\treturn false;\n \t\t\tbreak;","path":"libsolidity/ExpressionCompiler.cpp","position":39,"original_position":39,"commit_id":"de3e6a09db9612ca6fd28c7ccd02d82a1f27da6e","original_commit_id":"de3e6a09db9612ca6fd28c7ccd02d82a1f27da6e","user":{"login":"CJentzsch","id":8452011,"avatar_url":"https://avatars.githubusercontent.com/u/8452011?v=3","gravatar_id":"","url":"https://api.github.com/users/CJentzsch","html_url":"https://github.com/CJentzsch","followers_url":"https://api.github.com/users/CJentzsch/followers","following_url":"https://api.github.com/users/CJentzsch/following{/other_user}","gists_url":"https://api.github.com/users/CJentzsch/gists{/gist_id}","starred_url":"https://api.github.com/users/CJentzsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CJentzsch/subscriptions","organizations_url":"https://api.github.com/users/CJentzsch/orgs","repos_url":"https://api.github.com/users/CJentzsch/repos","events_url":"https://api.github.com/users/CJentzsch/events{/privacy}","received_events_url":"https://api.github.com/users/CJentzsch/received_events","type":"User","site_admin":false},"body":"This line can never be reached, you could as well omit it. (100% code coverage not possible :-) )","created_at":"2015-01-14T07:59:02Z","updated_at":"2015-01-14T07:59:02Z","html_url":"https://github.com/ethereum/cpp-ethereum/pull/799#discussion_r22920913","pull_request_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799","_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/22920913"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/799#discussion_r22920913"},"pull_request":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799","id":27287962,"html_url":"https://github.com/ethereum/cpp-ethereum/pull/799","diff_url":"https://github.com/ethereum/cpp-ethereum/pull/799.diff","patch_url":"https://github.com/ethereum/cpp-ethereum/pull/799.patch","issue_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/799","number":799,"state":"open","locked":false,"title":"Specify gas and value for function calls and contract creation calls.","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-13T17:20:54Z","updated_at":"2015-01-14T07:59:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53fcedc2a2e28ca957a7ed84cc7ce17d1ceb3d07","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799/commits","review_comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799/comments","review_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/799/comments","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/de3e6a09db9612ca6fd28c7ccd02d82a1f27da6e","head":{"label":"chriseth:sol_gasAndValue","ref":"sol_gasAndValue","sha":"de3e6a09db9612ca6fd28c7ccd02d82a1f27da6e","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"repo":{"id":24932538,"name":"cpp-ethereum","full_name":"chriseth/cpp-ethereum","owner":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chriseth/cpp-ethereum","description":"Gavin Wood's C++ implementation of the Ethereum yellowpaper.","fork":true,"url":"https://api.github.com/repos/chriseth/cpp-ethereum","forks_url":"https://api.github.com/repos/chriseth/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/chriseth/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chriseth/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chriseth/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/chriseth/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/chriseth/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/chriseth/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/chriseth/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/chriseth/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/chriseth/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/chriseth/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chriseth/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chriseth/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/chriseth/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chriseth/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/chriseth/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/chriseth/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/chriseth/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/chriseth/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/chriseth/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/chriseth/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/chriseth/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/chriseth/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/chriseth/cpp-ethereum/issues/comments/{number}","contents_url":"https://api.github.com/repos/chriseth/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/chriseth/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chriseth/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/chriseth/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chriseth/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/chriseth/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/chriseth/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/chriseth/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/chriseth/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chriseth/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/chriseth/cpp-ethereum/releases{/id}","created_at":"2014-10-08T09:01:35Z","updated_at":"2014-10-10T15:01:57Z","pushed_at":"2015-01-13T17:13:00Z","git_url":"git://github.com/chriseth/cpp-ethereum.git","ssh_url":"git@github.com:chriseth/cpp-ethereum.git","clone_url":"https://github.com/chriseth/cpp-ethereum.git","svn_url":"https://github.com/chriseth/cpp-ethereum","homepage":"www.gavwood.com/Paper.pdf","size":20176,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"ba6fc4efe03dfccb6c0f65fcb88fe25382597a1c","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":15460666,"name":"cpp-ethereum","full_name":"ethereum/cpp-ethereum","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/cpp-ethereum","description":"Gavin Wood's C++ implementation of the Ethereum yellowpaper.","fork":false,"url":"https://api.github.com/repos/ethereum/cpp-ethereum","forks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/ethereum/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/comments/{number}","contents_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/ethereum/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/cpp-ethereum/releases{/id}","created_at":"2013-12-26T21:26:06Z","updated_at":"2015-01-14T01:14:19Z","pushed_at":"2015-01-13T14:17:30Z","git_url":"git://github.com/ethereum/cpp-ethereum.git","ssh_url":"git@github.com:ethereum/cpp-ethereum.git","clone_url":"https://github.com/ethereum/cpp-ethereum.git","svn_url":"https://github.com/ethereum/cpp-ethereum","homepage":"www.gavwood.com/Paper.pdf","size":29894,"stargazers_count":385,"watchers_count":385,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":100,"forks":134,"open_issues":100,"watchers":385,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/799"},"issue":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/799"},"comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/799/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/799/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/de3e6a09db9612ca6fd28c7ccd02d82a1f27da6e"}}}}