{"action":"created","comment":{"url":"https://api.github.com/repos/WebAssembly/design/pulls/comments/41356981","id":41356981,"diff_hunk":"@@ -294,36 +294,40 @@ buffer.\n In the MVP, the length of the return types sequence may only be 0 or 1. This\n restriction may be lifted in the future.\n \n-Direct calls to a function specify the callee by index into a function table.\n+Direct calls to a function specify the callee by index into a *main function table*.\n \n   * `call`: call function directly\n \n-Calls must match the function signature exactly.\n+A direct call to a function with a mismatched signature is a module verification error.\n \n Like direct calls, calls to [imports](Modules.md#imports-and-exports) specify\n-the callee by index into an import table (defined by the sequence of import\n-declarations in the module import section) and the call must match the declared\n-signature of the import exactly.\n+the callee by index into an *imported function table* defined by the sequence of import\n+declarations in the module import section. A direct call to an imported function with a\n+mismatched signature is a module verification error.\n \n   * `call_import` : call imported function directly\n \n-Indirect calls may be made to a value of function-pointer type. A \n-function-pointer value may be obtained for a given function as specified by its index\n-in the function table.\n+Indirect calls allow calling target functions that are unknown at compile time.\n+The target function is an expression of local type `i32` and is always the first\n+input into the indirect call.\n+A `call_indirect` specifies the *expected* signature of the target function with\n+an index into a *signature table* defined by the module. \n+An indirect call to a function with a mismatched signature causes a trap.\n \n   * `call_indirect`: call function indirectly\n-  * `addressof`: obtain a function pointer value for a given function\n-\n-Function-pointer values are comparable for equality and the `addressof` operator\n-is monomorphic. Function-pointer values can be explicitly coerced to and from\n-integers (which, in particular, is necessary when loading/storing to memory\n-since memory only provides integer types). For security and safety reasons,\n-the integer value of a coerced function-pointer value is an abstract index and\n-does not reveal the actual machine code address of the target function.\n-\n-In the MVP, function pointer values are local to a single module. The\n-[dynamic linking](DynamicLinking.md) feature is necessary for\n-two modules to pass function pointers back and forth.\n+\n+Functions from the main function table are made addressable by defining an \n+*indirect function table* that consists of a sequence of indices\n+into the module's main function table. A function from the main table may appear more than","path":"AstSemantics.md","position":48,"original_position":48,"commit_id":"5cce2b53fae52f829daed99873b71cbe319cd097","original_commit_id":"5cce2b53fae52f829daed99873b71cbe319cd097","user":{"login":"JSStats","id":11826073,"avatar_url":"https://avatars.githubusercontent.com/u/11826073?v=3","gravatar_id":"","url":"https://api.github.com/users/JSStats","html_url":"https://github.com/JSStats","followers_url":"https://api.github.com/users/JSStats/followers","following_url":"https://api.github.com/users/JSStats/following{/other_user}","gists_url":"https://api.github.com/users/JSStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JSStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JSStats/subscriptions","organizations_url":"https://api.github.com/users/JSStats/orgs","repos_url":"https://api.github.com/users/JSStats/repos","events_url":"https://api.github.com/users/JSStats/events{/privacy}","received_events_url":"https://api.github.com/users/JSStats/received_events","type":"User","site_admin":false},"body":"Is the main function table local to each module?\r\n\r\nWhy has the indirect function table been introduced?\r\n\r\nAre the elements of the indirect function table observable to the wasm code? Can it be accessed to load the index?\r\n\r\nNo provision has been made for homogeneous function tables. These seem important for code that wants to avoid a runtime signature check.\r\n\r\n","created_at":"2015-10-07T06:54:45Z","updated_at":"2015-10-07T06:54:45Z","html_url":"https://github.com/WebAssembly/design/pull/392#discussion_r41356981","pull_request_url":"https://api.github.com/repos/WebAssembly/design/pulls/392","_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/comments/41356981"},"html":{"href":"https://github.com/WebAssembly/design/pull/392#discussion_r41356981"},"pull_request":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/392"}}},"pull_request":{"url":"https://api.github.com/repos/WebAssembly/design/pulls/392","id":46964205,"html_url":"https://github.com/WebAssembly/design/pull/392","diff_url":"https://github.com/WebAssembly/design/pull/392.diff","patch_url":"https://github.com/WebAssembly/design/pull/392.patch","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/392","number":392,"state":"open","locked":false,"title":"Update discussion of indirect calls and function pointers","user":{"login":"titzer","id":12184276,"avatar_url":"https://avatars.githubusercontent.com/u/12184276?v=3","gravatar_id":"","url":"https://api.github.com/users/titzer","html_url":"https://github.com/titzer","followers_url":"https://api.github.com/users/titzer/followers","following_url":"https://api.github.com/users/titzer/following{/other_user}","gists_url":"https://api.github.com/users/titzer/gists{/gist_id}","starred_url":"https://api.github.com/users/titzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titzer/subscriptions","organizations_url":"https://api.github.com/users/titzer/orgs","repos_url":"https://api.github.com/users/titzer/repos","events_url":"https://api.github.com/users/titzer/events{/privacy}","received_events_url":"https://api.github.com/users/titzer/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-06T22:05:01Z","updated_at":"2015-10-07T06:54:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"387c3aa927c7cd43332521a3154fed07d8e722ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WebAssembly/design/pulls/392/commits","review_comments_url":"https://api.github.com/repos/WebAssembly/design/pulls/392/comments","review_comment_url":"https://api.github.com/repos/WebAssembly/design/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/392/comments","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/5cce2b53fae52f829daed99873b71cbe319cd097","head":{"label":"WebAssembly:add_func_ptrs","ref":"add_func_ptrs","sha":"5cce2b53fae52f829daed99873b71cbe319cd097","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":34808241,"name":"design","full_name":"WebAssembly/design","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/design","description":"WebAssembly Design Documents","fork":false,"url":"https://api.github.com/repos/WebAssembly/design","forks_url":"https://api.github.com/repos/WebAssembly/design/forks","keys_url":"https://api.github.com/repos/WebAssembly/design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/design/teams","hooks_url":"https://api.github.com/repos/WebAssembly/design/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/design/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/design/events","assignees_url":"https://api.github.com/repos/WebAssembly/design/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/design/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/design/tags","blobs_url":"https://api.github.com/repos/WebAssembly/design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/design/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/design/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/design/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/design/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/design/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/design/subscription","commits_url":"https://api.github.com/repos/WebAssembly/design/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/design/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/design/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/design/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/design/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/design/merges","archive_url":"https://api.github.com/repos/WebAssembly/design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/design/downloads","issues_url":"https://api.github.com/repos/WebAssembly/design/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/design/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/design/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/design/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/design/releases{/id}","created_at":"2015-04-29T17:36:05Z","updated_at":"2015-10-07T06:10:40Z","pushed_at":"2015-10-06T23:29:28Z","git_url":"git://github.com/WebAssembly/design.git","ssh_url":"git@github.com:WebAssembly/design.git","clone_url":"https://github.com/WebAssembly/design.git","svn_url":"https://github.com/WebAssembly/design","homepage":"","size":3813,"stargazers_count":4437,"watchers_count":4437,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":223,"mirror_url":null,"open_issues_count":83,"forks":223,"open_issues":83,"watchers":4437,"default_branch":"master"}},"base":{"label":"WebAssembly:master","ref":"master","sha":"3341a62ba9e5d53092bfbec5520c14ff512a864f","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":34808241,"name":"design","full_name":"WebAssembly/design","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/design","description":"WebAssembly Design Documents","fork":false,"url":"https://api.github.com/repos/WebAssembly/design","forks_url":"https://api.github.com/repos/WebAssembly/design/forks","keys_url":"https://api.github.com/repos/WebAssembly/design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/design/teams","hooks_url":"https://api.github.com/repos/WebAssembly/design/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/design/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/design/events","assignees_url":"https://api.github.com/repos/WebAssembly/design/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/design/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/design/tags","blobs_url":"https://api.github.com/repos/WebAssembly/design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/design/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/design/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/design/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/design/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/design/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/design/subscription","commits_url":"https://api.github.com/repos/WebAssembly/design/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/design/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/design/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/design/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/design/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/design/merges","archive_url":"https://api.github.com/repos/WebAssembly/design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/design/downloads","issues_url":"https://api.github.com/repos/WebAssembly/design/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/design/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/design/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/design/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/design/releases{/id}","created_at":"2015-04-29T17:36:05Z","updated_at":"2015-10-07T06:10:40Z","pushed_at":"2015-10-06T23:29:28Z","git_url":"git://github.com/WebAssembly/design.git","ssh_url":"git@github.com:WebAssembly/design.git","clone_url":"https://github.com/WebAssembly/design.git","svn_url":"https://github.com/WebAssembly/design","homepage":"","size":3813,"stargazers_count":4437,"watchers_count":4437,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":223,"mirror_url":null,"open_issues_count":83,"forks":223,"open_issues":83,"watchers":4437,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/392"},"html":{"href":"https://github.com/WebAssembly/design/pull/392"},"issue":{"href":"https://api.github.com/repos/WebAssembly/design/issues/392"},"comments":{"href":"https://api.github.com/repos/WebAssembly/design/issues/392/comments"},"review_comments":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/392/comments"},"review_comment":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/392/commits"},"statuses":{"href":"https://api.github.com/repos/WebAssembly/design/statuses/5cce2b53fae52f829daed99873b71cbe319cd097"}}}}