{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/73","labels_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/73/comments","events_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/73/events","html_url":"https://github.com/WebAssembly/v8-native-prototype/issues/73","id":117958761,"number":73,"title":"using load with offset allows reading out of bounds","user":{"login":"binji","id":1245315,"avatar_url":"https://avatars.githubusercontent.com/u/1245315?v=3","gravatar_id":"","url":"https://api.github.com/users/binji","html_url":"https://github.com/binji","followers_url":"https://api.github.com/users/binji/followers","following_url":"https://api.github.com/users/binji/following{/other_user}","gists_url":"https://api.github.com/users/binji/gists{/gist_id}","starred_url":"https://api.github.com/users/binji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binji/subscriptions","organizations_url":"https://api.github.com/users/binji/orgs","repos_url":"https://api.github.com/users/binji/repos","events_url":"https://api.github.com/users/binji/events{/privacy}","received_events_url":"https://api.github.com/users/binji/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-20T03:34:52Z","updated_at":"2015-12-02T09:23:41Z","closed_at":"2015-12-02T09:23:40Z","body":"The spec repo has this test:\r\n```\r\n(module\r\n    (memory 1024 (segment 0 \"abcdefghijklmnopqrstuvwxyz\"))\r\n    (import $print \"stdio\" \"print\" (param i32))\r\n\r\n    (func $good (param $i i32)\r\n        (call_import $print (i32.load8_u offset=0 (get_local $i)))  ;; 97 'a'\r\n        (call_import $print (i32.load8_u offset=1 (get_local $i)))  ;; 98 'b'\r\n        (call_import $print (i32.load8_u offset=2 (get_local $i)))  ;; 99 'c'\r\n        (call_import $print (i32.load8_u offset=25 (get_local $i))) ;; 122 'z'\r\n\r\n        (call_import $print (i32.load16_u offset=0 (get_local $i)))          ;; 25185 'ab'\r\n        (call_import $print (i32.load16_u offset=1 align=1 (get_local $i)))  ;; 25442 'bc'\r\n        (call_import $print (i32.load16_u offset=2 (get_local $i)))          ;; 25699 'cd'\r\n        (call_import $print (i32.load16_u offset=25 align=1 (get_local $i))) ;; 122 'z\\0'\r\n\r\n        (call_import $print (i32.load offset=0 (get_local $i)))          ;; 1684234849 'abcd'\r\n        (call_import $print (i32.load offset=1 align=1 (get_local $i)))  ;; 1701077858 'bcde'\r\n        (call_import $print (i32.load offset=2 align=2 (get_local $i)))  ;; 1717920867 'cdef'\r\n        (call_import $print (i32.load offset=25 align=1 (get_local $i))) ;; 122 'z\\0\\0\\0'\r\n    )\r\n    (export \"good\" $good)\r\n\r\n  ...\r\n)\r\n\r\n...\r\n(assert_trap (invoke \"good\" (i32.const 996)) \"out of bounds memory access\")\r\n...\r\n```\r\nInstead of trapping, this seems to read out of bounds for the very last load: on my laptop it returns 2013265920 (0x78000000). On my desktop it was returning 1744830464 (0x68000000)."},"comment":{"url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/comments/161232568","html_url":"https://github.com/WebAssembly/v8-native-prototype/issues/73#issuecomment-161232568","issue_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/73","id":161232568,"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},"created_at":"2015-12-02T09:23:40Z","updated_at":"2015-12-02T09:23:40Z","body":"This should be fixed with https://github.com/WebAssembly/v8-native-prototype/commit/e8a8a00b54efdf36fa220198ef3ad095e997b869"}}