{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/190343168","pull_request_review_id":122699505,"id":190343168,"diff_hunk":"@@ -315,7 +315,41 @@ IR::Instr * LegalizeMD::LegalizeLoad(IR::Instr *instr, uint opndNum, LegalForms\n \n void LegalizeMD::LegalizeIndirOffset(IR::Instr * instr, IR::IndirOpnd * indirOpnd, LegalForms forms, bool fPostRegAlloc)\n {\n-   int32 offset = indirOpnd->GetOffset();\n+    // For LEA, we have special handling of indiropnds\n+    auto correctSize = [](IR::Instr* instr, IR::IndirOpnd* indirOpnd)\n+    {\n+        // If the base and index operands on an LEA are different sizes, grow the smaller one,\n+        // matching the larger size but keeping the correct signedness for the type\n+        IR::RegOpnd* baseOpnd = indirOpnd->GetBaseOpnd();\n+        IR::RegOpnd* indexOpnd = indirOpnd->GetIndexOpnd();\n+        if (   baseOpnd != nullptr\n+            && indexOpnd != nullptr\n+            && baseOpnd->GetSize() != indexOpnd->GetSize()\n+            )\n+        {\n+            if (baseOpnd->GetSize() < indexOpnd->GetSize())","path":"lib/Backend/arm64/LegalizeMD.cpp","position":17,"original_position":17,"commit_id":"6d298fe1090cb4a84580ac1a176571b1f9dea1d7","original_commit_id":"6d298fe1090cb4a84580ac1a176571b1f9dea1d7","user":{"login":"sigatrev","id":5722242,"avatar_url":"https://avatars0.githubusercontent.com/u/5722242?v=4","gravatar_id":"","url":"https://api.github.com/users/sigatrev","html_url":"https://github.com/sigatrev","followers_url":"https://api.github.com/users/sigatrev/followers","following_url":"https://api.github.com/users/sigatrev/following{/other_user}","gists_url":"https://api.github.com/users/sigatrev/gists{/gist_id}","starred_url":"https://api.github.com/users/sigatrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigatrev/subscriptions","organizations_url":"https://api.github.com/users/sigatrev/orgs","repos_url":"https://api.github.com/users/sigatrev/repos","events_url":"https://api.github.com/users/sigatrev/events{/privacy}","received_events_url":"https://api.github.com/users/sigatrev/received_events","type":"User","site_admin":false},"body":"I think we should assert(probably outside of the lambda) that baseOpnd is 64 bit. While it is not unreasonable to have a 32 bit index opnd for an LEA after doing 32 bit math, having a 32 base opnd on a 64 bit system is an error.","created_at":"2018-05-23T17:55:49Z","updated_at":"2018-05-23T17:59:29Z","html_url":"https://github.com/Microsoft/ChakraCore/pull/5217#discussion_r190343168","pull_request_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/190343168"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/5217#discussion_r190343168"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217","id":189838371,"html_url":"https://github.com/Microsoft/ChakraCore/pull/5217","diff_url":"https://github.com/Microsoft/ChakraCore/pull/5217.diff","patch_url":"https://github.com/Microsoft/ChakraCore/pull/5217.patch","issue_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5217","number":5217,"state":"open","locked":false,"title":"Fix ARM64 LEA legalization","user":{"login":"Penguinwizzard","id":69503,"avatar_url":"https://avatars0.githubusercontent.com/u/69503?v=4","gravatar_id":"","url":"https://api.github.com/users/Penguinwizzard","html_url":"https://github.com/Penguinwizzard","followers_url":"https://api.github.com/users/Penguinwizzard/followers","following_url":"https://api.github.com/users/Penguinwizzard/following{/other_user}","gists_url":"https://api.github.com/users/Penguinwizzard/gists{/gist_id}","starred_url":"https://api.github.com/users/Penguinwizzard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Penguinwizzard/subscriptions","organizations_url":"https://api.github.com/users/Penguinwizzard/orgs","repos_url":"https://api.github.com/users/Penguinwizzard/repos","events_url":"https://api.github.com/users/Penguinwizzard/events{/privacy}","received_events_url":"https://api.github.com/users/Penguinwizzard/received_events","type":"User","site_admin":false},"body":"Because we weren't checking the types of things, there were a few ways that the conversion of LEA instructions to ADD instructions on ARM64 could go wrong. This changeset fixes legalization of these instructions to properly handle all of the cases.","created_at":"2018-05-23T02:10:03Z","updated_at":"2018-05-23T17:59:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27ea4e4c71ca19dd6a0a8f1442e5e6d959fdff79","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217/commits","review_comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217/comments","review_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5217/comments","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/6d298fe1090cb4a84580ac1a176571b1f9dea1d7","head":{"label":"Penguinwizzard:fix_arm64_operandlength","ref":"fix_arm64_operandlength","sha":"6d298fe1090cb4a84580ac1a176571b1f9dea1d7","user":{"login":"Penguinwizzard","id":69503,"avatar_url":"https://avatars0.githubusercontent.com/u/69503?v=4","gravatar_id":"","url":"https://api.github.com/users/Penguinwizzard","html_url":"https://github.com/Penguinwizzard","followers_url":"https://api.github.com/users/Penguinwizzard/followers","following_url":"https://api.github.com/users/Penguinwizzard/following{/other_user}","gists_url":"https://api.github.com/users/Penguinwizzard/gists{/gist_id}","starred_url":"https://api.github.com/users/Penguinwizzard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Penguinwizzard/subscriptions","organizations_url":"https://api.github.com/users/Penguinwizzard/orgs","repos_url":"https://api.github.com/users/Penguinwizzard/repos","events_url":"https://api.github.com/users/Penguinwizzard/events{/privacy}","received_events_url":"https://api.github.com/users/Penguinwizzard/received_events","type":"User","site_admin":false},"repo":{"id":68159295,"name":"ChakraCore","full_name":"Penguinwizzard/ChakraCore","owner":{"login":"Penguinwizzard","id":69503,"avatar_url":"https://avatars0.githubusercontent.com/u/69503?v=4","gravatar_id":"","url":"https://api.github.com/users/Penguinwizzard","html_url":"https://github.com/Penguinwizzard","followers_url":"https://api.github.com/users/Penguinwizzard/followers","following_url":"https://api.github.com/users/Penguinwizzard/following{/other_user}","gists_url":"https://api.github.com/users/Penguinwizzard/gists{/gist_id}","starred_url":"https://api.github.com/users/Penguinwizzard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Penguinwizzard/subscriptions","organizations_url":"https://api.github.com/users/Penguinwizzard/orgs","repos_url":"https://api.github.com/users/Penguinwizzard/repos","events_url":"https://api.github.com/users/Penguinwizzard/events{/privacy}","received_events_url":"https://api.github.com/users/Penguinwizzard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Penguinwizzard/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":true,"url":"https://api.github.com/repos/Penguinwizzard/ChakraCore","forks_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/forks","keys_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/teams","hooks_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/events","assignees_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/tags","blobs_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/subscription","commits_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/merges","archive_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/downloads","issues_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/Penguinwizzard/ChakraCore/deployments","created_at":"2016-09-14T00:39:02Z","updated_at":"2016-09-14T00:39:23Z","pushed_at":"2018-05-23T02:10:03Z","git_url":"git://github.com/Penguinwizzard/ChakraCore.git","ssh_url":"git@github.com:Penguinwizzard/ChakraCore.git","clone_url":"https://github.com/Penguinwizzard/ChakraCore.git","svn_url":"https://github.com/Penguinwizzard/ChakraCore","homepage":null,"size":177545,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"d04e9e745701694ab47317c748eb9ba7efe5c6ef","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":49086513,"name":"ChakraCore","full_name":"Microsoft/ChakraCore","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":false,"url":"https://api.github.com/repos/Microsoft/ChakraCore","forks_url":"https://api.github.com/repos/Microsoft/ChakraCore/forks","keys_url":"https://api.github.com/repos/Microsoft/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/ChakraCore/teams","hooks_url":"https://api.github.com/repos/Microsoft/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/events","assignees_url":"https://api.github.com/repos/Microsoft/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/tags","blobs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/Microsoft/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscription","commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/ChakraCore/merges","archive_url":"https://api.github.com/repos/Microsoft/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/ChakraCore/downloads","issues_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/ChakraCore/deployments","created_at":"2016-01-05T19:05:31Z","updated_at":"2018-05-23T14:12:54Z","pushed_at":"2018-05-23T05:30:48Z","git_url":"git://github.com/Microsoft/ChakraCore.git","ssh_url":"git@github.com:Microsoft/ChakraCore.git","clone_url":"https://github.com/Microsoft/ChakraCore.git","svn_url":"https://github.com/Microsoft/ChakraCore","homepage":"","size":136318,"stargazers_count":7026,"watchers_count":7026,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":927,"mirror_url":null,"archived":false,"open_issues_count":329,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":927,"open_issues":329,"watchers":7026,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/5217"},"issue":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5217"},"comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5217/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/5217/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/6d298fe1090cb4a84580ac1a176571b1f9dea1d7"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"sigatrev"}}