Skip to content
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

Merged
merged 1 commit into from
Apr 24, 2024
Merged

finishing bulk.wast #281

merged 1 commit into from
Apr 24, 2024

Conversation

andreaTP
Copy link
Collaborator

Finishing the last few bulk.wast missing tests.

@andreaTP andreaTP requested review from bhelx and mariofusco April 18, 2024 12:29
Comment on lines +1602 to +1618
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;
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

@bhelx bhelx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@andreaTP andreaTP merged commit b84c013 into dylibso:main Apr 24, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants