{"action":"created","comment":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/110183373","pull_request_review_id":31337057,"id":110183373,"diff_hunk":"@@ -40,66 +41,41 @@ Function: build_function_environment\n exprt::operandst build_function_environment(\n   const code_typet::parameterst &parameters,\n   code_blockt &init_code,\n-  symbol_tablet &symbol_table)\n+  symbol_tablet &symbol_table,\n+  message_handlert &message_handler)\n {\n-  exprt::operandst result;\n-  result.resize(parameters.size());\n+  exprt::operandst main_arguments;\n+  main_arguments.resize(parameters.size());\n \n-  std::size_t i=0;\n-\n-  for(const auto &p : parameters)\n+  for(std::size_t param_number=0;\n+      param_number<parameters.size();\n+      param_number++)\n   {\n-    irep_idt base_name=p.get_base_name().empty()?\n-      (\"argument#\"+std::to_string(i)):p.get_base_name();\n-    irep_idt identifier=id2string(goto_functionst::entry_point())+\n-      \"::\"+id2string(base_name);\n-\n-    {\n-      auxiliary_symbolt new_symbol;\n-      new_symbol.mode=ID_C;\n-      new_symbol.is_static_lifetime=false;\n-      new_symbol.name=identifier;\n-      new_symbol.base_name=base_name;\n-      new_symbol.type=p.type();\n-\n-      symbol_table.move(new_symbol);\n-    }\n-\n-    symbol_exprt symbol_expr(identifier, p.type());\n-\n-    code_declt decl;\n-    decl.symbol()=symbol_expr;\n-\n-    init_code.add(decl);\n-\n-    // nondet init for _Bool\n-    if(decl.symbol().type().id()==ID_c_bool)\n-    {\n-      code_assignt assign(\n-        decl.symbol(),\n-        typecast_exprt(\n-          side_effect_expr_nondett(bool_typet()),\n-          decl.symbol().type()));\n-\n-      init_code.move_to_operands(assign);\n-    }\n-\n-    codet input(ID_input);\n-    input.operands().resize(2);\n-\n-    // record as an input\n-    input.op0()=address_of_exprt(\n-      index_exprt(string_constantt(base_name), from_integer(0, index_type())));\n-    input.op1()=symbol_expr;\n-    input.add_source_location()=p.source_location();\n-\n-    init_code.move_to_operands(input);\n-\n-    result[i]=symbol_expr;\n-    i++;\n+    const code_typet::parametert &p = parameters[param_number];\n+\n+    bool allow_null=true;\n+    input_recordert input_recorder(p.source_location());\n+\n+    main_arguments[param_number]=c_nondet_symbol_factory(\n+      p,\n+      param_number,\n+      p.type(),\n+      init_code,\n+      allow_null,\n+      symbol_table,\n+      p.source_location(),","path":"src/ansi-c/ansi_c_entry_point.cpp","position":88,"original_position":88,"commit_id":"74f8eaaecc6de5635933d69dca74c659fc9678f1","original_commit_id":"74f8eaaecc6de5635933d69dca74c659fc9678f1","user":{"login":"owen-jones-diffblue","id":25899187,"avatar_url":"https://avatars3.githubusercontent.com/u/25899187?v=3","gravatar_id":"","url":"https://api.github.com/users/owen-jones-diffblue","html_url":"https://github.com/owen-jones-diffblue","followers_url":"https://api.github.com/users/owen-jones-diffblue/followers","following_url":"https://api.github.com/users/owen-jones-diffblue/following{/other_user}","gists_url":"https://api.github.com/users/owen-jones-diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/owen-jones-diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owen-jones-diffblue/subscriptions","organizations_url":"https://api.github.com/users/owen-jones-diffblue/orgs","repos_url":"https://api.github.com/users/owen-jones-diffblue/repos","events_url":"https://api.github.com/users/owen-jones-diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/owen-jones-diffblue/received_events","type":"User","site_admin":false},"body":"I was trying to keep it similar to object_factory() in src/java_bytecode/java_object_factory.cpp so that they can be easily combined in future. If it is preferable then I can instead simplify it and reduce the number of arguments.","created_at":"2017-04-06T14:54:06Z","updated_at":"2017-04-06T14:54:06Z","html_url":"https://github.com/diffblue/cbmc/pull/767#discussion_r110183373","pull_request_url":"https://api.github.com/repos/diffblue/cbmc/pulls/767","_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments/110183373"},"html":{"href":"https://github.com/diffblue/cbmc/pull/767#discussion_r110183373"},"pull_request":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/767"}}},"pull_request":{"url":"https://api.github.com/repos/diffblue/cbmc/pulls/767","id":114575598,"html_url":"https://github.com/diffblue/cbmc/pull/767","diff_url":"https://github.com/diffblue/cbmc/pull/767.diff","patch_url":"https://github.com/diffblue/cbmc/pull/767.patch","issue_url":"https://api.github.com/repos/diffblue/cbmc/issues/767","number":767,"state":"open","locked":false,"title":"Reorganise C parameter creation","user":{"login":"owen-jones-diffblue","id":25899187,"avatar_url":"https://avatars3.githubusercontent.com/u/25899187?v=3","gravatar_id":"","url":"https://api.github.com/users/owen-jones-diffblue","html_url":"https://github.com/owen-jones-diffblue","followers_url":"https://api.github.com/users/owen-jones-diffblue/followers","following_url":"https://api.github.com/users/owen-jones-diffblue/following{/other_user}","gists_url":"https://api.github.com/users/owen-jones-diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/owen-jones-diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owen-jones-diffblue/subscriptions","organizations_url":"https://api.github.com/users/owen-jones-diffblue/orgs","repos_url":"https://api.github.com/users/owen-jones-diffblue/repos","events_url":"https://api.github.com/users/owen-jones-diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/owen-jones-diffblue/received_events","type":"User","site_admin":false},"body":"Make it match the java code more closely to prepare for (a) one day\r\nmerging them and (b) dealing with pointer parameters.","created_at":"2017-04-06T11:06:43Z","updated_at":"2017-04-06T14:54:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89451397b71eaea8e16527e773709f5d880354e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/diffblue/cbmc/pulls/767/commits","review_comments_url":"https://api.github.com/repos/diffblue/cbmc/pulls/767/comments","review_comment_url":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diffblue/cbmc/issues/767/comments","statuses_url":"https://api.github.com/repos/diffblue/cbmc/statuses/74f8eaaecc6de5635933d69dca74c659fc9678f1","head":{"label":"owen-jones-diffblue:feature/pointer-function-parameters","ref":"feature/pointer-function-parameters","sha":"74f8eaaecc6de5635933d69dca74c659fc9678f1","user":{"login":"owen-jones-diffblue","id":25899187,"avatar_url":"https://avatars3.githubusercontent.com/u/25899187?v=3","gravatar_id":"","url":"https://api.github.com/users/owen-jones-diffblue","html_url":"https://github.com/owen-jones-diffblue","followers_url":"https://api.github.com/users/owen-jones-diffblue/followers","following_url":"https://api.github.com/users/owen-jones-diffblue/following{/other_user}","gists_url":"https://api.github.com/users/owen-jones-diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/owen-jones-diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owen-jones-diffblue/subscriptions","organizations_url":"https://api.github.com/users/owen-jones-diffblue/orgs","repos_url":"https://api.github.com/users/owen-jones-diffblue/repos","events_url":"https://api.github.com/users/owen-jones-diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/owen-jones-diffblue/received_events","type":"User","site_admin":false},"repo":{"id":82556977,"name":"cbmc","full_name":"owen-jones-diffblue/cbmc","owner":{"login":"owen-jones-diffblue","id":25899187,"avatar_url":"https://avatars3.githubusercontent.com/u/25899187?v=3","gravatar_id":"","url":"https://api.github.com/users/owen-jones-diffblue","html_url":"https://github.com/owen-jones-diffblue","followers_url":"https://api.github.com/users/owen-jones-diffblue/followers","following_url":"https://api.github.com/users/owen-jones-diffblue/following{/other_user}","gists_url":"https://api.github.com/users/owen-jones-diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/owen-jones-diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owen-jones-diffblue/subscriptions","organizations_url":"https://api.github.com/users/owen-jones-diffblue/orgs","repos_url":"https://api.github.com/users/owen-jones-diffblue/repos","events_url":"https://api.github.com/users/owen-jones-diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/owen-jones-diffblue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/owen-jones-diffblue/cbmc","description":"C Bounded Model Checker","fork":true,"url":"https://api.github.com/repos/owen-jones-diffblue/cbmc","forks_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/forks","keys_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/teams","hooks_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/hooks","issue_events_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/issues/events{/number}","events_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/events","assignees_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/assignees{/user}","branches_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/branches{/branch}","tags_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/tags","blobs_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/languages","stargazers_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/stargazers","contributors_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/contributors","subscribers_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/subscribers","subscription_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/subscription","commits_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/contents/{+path}","compare_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/merges","archive_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/downloads","issues_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/issues{/number}","pulls_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/labels{/name}","releases_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/releases{/id}","deployments_url":"https://api.github.com/repos/owen-jones-diffblue/cbmc/deployments","created_at":"2017-02-20T12:45:57Z","updated_at":"2017-02-20T12:46:06Z","pushed_at":"2017-04-06T14:45:21Z","git_url":"git://github.com/owen-jones-diffblue/cbmc.git","ssh_url":"git@github.com:owen-jones-diffblue/cbmc.git","clone_url":"https://github.com/owen-jones-diffblue/cbmc.git","svn_url":"https://github.com/owen-jones-diffblue/cbmc","homepage":"http://www.cprover.org/cbmc","size":18246,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"diffblue:master","ref":"master","sha":"01ed76a79458fd12f25487964f87c04a6ddf263b","user":{"login":"diffblue","id":17216098,"avatar_url":"https://avatars3.githubusercontent.com/u/17216098?v=3","gravatar_id":"","url":"https://api.github.com/users/diffblue","html_url":"https://github.com/diffblue","followers_url":"https://api.github.com/users/diffblue/followers","following_url":"https://api.github.com/users/diffblue/following{/other_user}","gists_url":"https://api.github.com/users/diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diffblue/subscriptions","organizations_url":"https://api.github.com/users/diffblue/orgs","repos_url":"https://api.github.com/users/diffblue/repos","events_url":"https://api.github.com/users/diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/diffblue/received_events","type":"Organization","site_admin":false},"repo":{"id":51877056,"name":"cbmc","full_name":"diffblue/cbmc","owner":{"login":"diffblue","id":17216098,"avatar_url":"https://avatars3.githubusercontent.com/u/17216098?v=3","gravatar_id":"","url":"https://api.github.com/users/diffblue","html_url":"https://github.com/diffblue","followers_url":"https://api.github.com/users/diffblue/followers","following_url":"https://api.github.com/users/diffblue/following{/other_user}","gists_url":"https://api.github.com/users/diffblue/gists{/gist_id}","starred_url":"https://api.github.com/users/diffblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diffblue/subscriptions","organizations_url":"https://api.github.com/users/diffblue/orgs","repos_url":"https://api.github.com/users/diffblue/repos","events_url":"https://api.github.com/users/diffblue/events{/privacy}","received_events_url":"https://api.github.com/users/diffblue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diffblue/cbmc","description":"C Bounded Model Checker","fork":false,"url":"https://api.github.com/repos/diffblue/cbmc","forks_url":"https://api.github.com/repos/diffblue/cbmc/forks","keys_url":"https://api.github.com/repos/diffblue/cbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diffblue/cbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diffblue/cbmc/teams","hooks_url":"https://api.github.com/repos/diffblue/cbmc/hooks","issue_events_url":"https://api.github.com/repos/diffblue/cbmc/issues/events{/number}","events_url":"https://api.github.com/repos/diffblue/cbmc/events","assignees_url":"https://api.github.com/repos/diffblue/cbmc/assignees{/user}","branches_url":"https://api.github.com/repos/diffblue/cbmc/branches{/branch}","tags_url":"https://api.github.com/repos/diffblue/cbmc/tags","blobs_url":"https://api.github.com/repos/diffblue/cbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diffblue/cbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diffblue/cbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/diffblue/cbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diffblue/cbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/diffblue/cbmc/languages","stargazers_url":"https://api.github.com/repos/diffblue/cbmc/stargazers","contributors_url":"https://api.github.com/repos/diffblue/cbmc/contributors","subscribers_url":"https://api.github.com/repos/diffblue/cbmc/subscribers","subscription_url":"https://api.github.com/repos/diffblue/cbmc/subscription","commits_url":"https://api.github.com/repos/diffblue/cbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/diffblue/cbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/diffblue/cbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/diffblue/cbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/diffblue/cbmc/contents/{+path}","compare_url":"https://api.github.com/repos/diffblue/cbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diffblue/cbmc/merges","archive_url":"https://api.github.com/repos/diffblue/cbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diffblue/cbmc/downloads","issues_url":"https://api.github.com/repos/diffblue/cbmc/issues{/number}","pulls_url":"https://api.github.com/repos/diffblue/cbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/diffblue/cbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/diffblue/cbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diffblue/cbmc/labels{/name}","releases_url":"https://api.github.com/repos/diffblue/cbmc/releases{/id}","deployments_url":"https://api.github.com/repos/diffblue/cbmc/deployments","created_at":"2016-02-16T23:03:52Z","updated_at":"2017-03-28T20:13:09Z","pushed_at":"2017-04-06T14:48:11Z","git_url":"git://github.com/diffblue/cbmc.git","ssh_url":"git@github.com:diffblue/cbmc.git","clone_url":"https://github.com/diffblue/cbmc.git","svn_url":"https://github.com/diffblue/cbmc","homepage":"http://www.cprover.org/cbmc","size":18585,"stargazers_count":37,"watchers_count":37,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":199,"forks":49,"open_issues":199,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/767"},"html":{"href":"https://github.com/diffblue/cbmc/pull/767"},"issue":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/767"},"comments":{"href":"https://api.github.com/repos/diffblue/cbmc/issues/767/comments"},"review_comments":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/767/comments"},"review_comment":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diffblue/cbmc/pulls/767/commits"},"statuses":{"href":"https://api.github.com/repos/diffblue/cbmc/statuses/74f8eaaecc6de5635933d69dca74c659fc9678f1"}}}}
{"actor":{"display_login":"owen-jones-diffblue"}}