Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1670)

Issue 2633153002: [wasm] Catch attempt to export non-existent memory (Closed)

Created:
3 years, 11 months ago by rossberg
Modified:
3 years, 11 months ago
Reviewers:
titzer
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Catch attempt to export non-existent memory R=titzer@chromium.org BUG=v8:5840 Review-Url: https://codereview.chromium.org/2633153002 Cr-Commit-Position: refs/heads/master@{#42384} Committed: https://chromium.googlesource.com/v8/v8/+/39e455db0d9fe5a57fb2eccc8811ffb7b52985d9

Patch Set 1 #

Total comments: 2

Patch Set 2 : Added TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -1 line) Patch
M src/wasm/module-decoder.cc View 1 1 chunk +5 lines, -1 line 0 comments Download
M test/mjsunit/wasm/instantiate-module-basic.js View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (6 generated)
rossberg
3 years, 11 months ago (2017-01-16 15:48:53 UTC) #1
titzer
https://codereview.chromium.org/2633153002/diff/1/src/wasm/module-decoder.cc File src/wasm/module-decoder.cc (right): https://codereview.chromium.org/2633153002/diff/1/src/wasm/module-decoder.cc#newcode460 src/wasm/module-decoder.cc:460: if (!module->has_memory || index != 0) { Should we ...
3 years, 11 months ago (2017-01-16 15:54:16 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2633153002/20001
3 years, 11 months ago (2017-01-16 17:03:11 UTC) #4
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
3 years, 11 months ago (2017-01-16 17:03:12 UTC) #6
rossberg
https://codereview.chromium.org/2633153002/diff/1/src/wasm/module-decoder.cc File src/wasm/module-decoder.cc (right): https://codereview.chromium.org/2633153002/diff/1/src/wasm/module-decoder.cc#newcode460 src/wasm/module-decoder.cc:460: if (!module->has_memory || index != 0) { On 2017/01/16 ...
3 years, 11 months ago (2017-01-16 17:03:12 UTC) #7
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
3 years, 11 months ago (2017-01-16 17:03:23 UTC) #9
titzer
lgtm
3 years, 11 months ago (2017-01-16 17:09:05 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2633153002/20001
3 years, 11 months ago (2017-01-16 17:18:11 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/v8/v8/+/39e455db0d9fe5a57fb2eccc8811ffb7b52985d9
3 years, 11 months ago (2017-01-16 17:44:53 UTC) #15
Mircea Trofin
On 2017/01/16 17:44:53, commit-bot: I haz the power wrote: > Committed patchset #2 (id:20001) as ...
3 years, 11 months ago (2017-01-16 21:45:02 UTC) #16
rossberg
3 years, 11 months ago (2017-01-17 10:37:40 UTC) #17
Message was sent while issue was closed.
On 2017/01/16 21:45:02, Mircea Trofin wrote:
> On 2017/01/16 17:44:53, commit-bot: I haz the power wrote:
> > Committed patchset #2 (id:20001) as
> >
>
https://chromium.googlesource.com/v8/v8/+/39e455db0d9fe5a57fb2eccc8811ffb7b52...
> 
> Could you point me to the place in the spec where this is captured - because I
> think we have an inconsistency; look at
>
https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyinstance-o...,
> see the "exports" part, from "3" on - it seems to suggest (the iii part) that
in
> the non-existent case, we create a memory (that's a bit weird, frankly)
> 
> The change here would trigger an error before that would happen.
> 
> My guess is we want what your change does, but then we need to reconcile the
API
> spec.

It wasn't an API bug, it was a validation bug. Obviously, you shouldn't be able
to export something that's not bound. The spec interpreter requires the check
here, by looking up the item in the context:

https://github.com/WebAssembly/spec/blob/master/interpreter/spec/valid.ml#L403

The part from JS.md you cite is about creating a JS `WebAssembly.Memory` wrapper
object if none exists yet, not the memory itself (that would be `m` in the algo,
which already exists).

Powered by Google App Engine
This is Rietveld 408576698