Skip to content

Fix rot13 test on big-endian platforms - #2386

Merged
sbc100 merged 1 commit into
WebAssembly:mainfrom
SoniEx2:be-rot13
Feb 8, 2024
Merged

sbc100 merged 1 commit into
WebAssembly:mainfrom
SoniEx2:be-rot13

Conversation

@SoniEx2

@SoniEx2 SoniEx2 commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator

arguably more like "implement big-endian support in rot13 test" rather than a "fix" but anyway.

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm % comment

Comment thread src/test-interp.cc
#else
std::copy(string_data.begin(), string_data.begin() + size,
memory->UnsafeData() + ptr);
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It it worth extracting a named function here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's the only test that needs this (*currently) so probably not yet?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What I mean is that this logic seems to be duplicated with lines 535 to 542 below. Would a "CopyUserMemory" helper function make sense?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

not in this context, these are slightly different operations (copy to memory vs copy from memory) and we can't think of a good way to abstract over both of them.

the APIs between host and wasm are rather lacking in pretty much every standalone wasm engine we've tried. allegedly interface types were supposed to help with this but uh... wabt doesn't really have those yet. (and probably won't for a while...)

@sbc100
sbc100 enabled auto-merge (squash) February 8, 2024 22:24
auto-merge was automatically disabled February 8, 2024 22:38

Head branch was pushed to by a user without write access

@SoniEx2

SoniEx2 commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator Author

@sbc100 sorry, try again, it needed to be rebased

@sbc100
sbc100 enabled auto-merge (squash) February 8, 2024 22:43
@sbc100
sbc100 merged commit 1263c6a into WebAssembly:main Feb 8, 2024
@SoniEx2
SoniEx2 deleted the be-rot13 branch February 8, 2024 23:43
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