-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finishing bulk.wast
#281
finishing bulk.wast
#281
Conversation
a4a63cd
to
507ffcc
Compare
507ffcc
to
13bbd6a
Compare
var elementCount = instance.elementCount(); | ||
var currentElement = instance.element(elementidx); | ||
var currentElementCount = | ||
(currentElement instanceof PassiveElement) ? currentElement.elementCount() : 0; | ||
boolean isOutOfBounds = | ||
(size < 0 | ||
|| elementidx > elementCount | ||
|| (size > 0 | ||
&& (currentElement == null | ||
|| !(currentElement instanceof PassiveElement))) | ||
|| elemidx + size > currentElementCount | ||
|| end > table.size()); | ||
|
||
if (isOutOfBounds) { | ||
throw new WASMRuntimeException("out of bounds table access"); | ||
} else if (size == 0) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is a little bit hard to follow and might make sense to break into some variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, that's the best I could come up with ... but I secretly hope that it will be split and moved to other classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Finishing the last few
bulk.wast
missing tests.