-
Notifications
You must be signed in to change notification settings - Fork 793
Implement StringConcat in the interpreter. #6403
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
Conversation
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!
Don't we need to pay special care around concat of two invalid UTF-16 strings? (e.g. with unmatched surrogate pairs) |
More fixes.
I am actually not sure what the spec says about that. It's worth looking into, though it could be left as a TODO from my perspective. |
So I couldn't find detailed specification for the behavior of concat other than the documentations for Do the Literals in the binaryen representation correspond to WTF-16 chars or to UTF-8 bytes? |
I believe the intention was that they correspond to bytes, though that was the plan when we intended to support more than JS strings (as the stringref proposal did). If all we need to support is WTF-16 for JS then perhaps we can simplify that.
Thanks, that makes sense. That makes me think that maybe a good way to get coverage here is to find the JS tests for |
( |
Still trying to get used to the workflow. Do you use the |
Doing |
To do it manually, copy the diff from CI which is diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 99733bc64..13ac19d92 [10](https://github.com/WebAssembly/binaryen/actions/runs/8290790765/job/22689511066?pr=6403#step:6:11)0644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1919,7 +1919,7 @@ public:
}
return Literal(int32_t(data->values.size()));
}
- Flow visitStringConcat(StringConcat* curr) {
+ Flow visitStringConcat(StringConcat* curr) {
NOTE_ENTER("StringConcat");
Flow flow = visit(curr->left);
if (flow.breaking()) {
@@ -[19](https://github.com/WebAssembly/binaryen/actions/runs/8290790765/job/22689511066?pr=6403#step:6:20)86,7 +1986,7 @@ public:
return Literal(int32_t(refData->values.size()));
}
-
+
Flow visitStringEq(StringEq* curr) {
NOTE_ENTER("StringEq");
Flow flow = visit(curr->left); into a local file, say |
No description provided.