summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/wasm-ctor-eval.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp
index eb2a4eb5d..9aa41c04d 100644
--- a/src/tools/wasm-ctor-eval.cpp
+++ b/src/tools/wasm-ctor-eval.cpp
@@ -889,6 +889,12 @@ public:
} else if (heapType.isArray()) {
// TODO: for repeated identical values, can use ArrayNew
init = builder.makeArrayNewFixed(heapType, args);
+ } else if (heapType.isString()) {
+ std::string s;
+ for (auto c : values) {
+ s += char(c.getInteger());
+ }
+ init = builder.makeStringConst(s);
} else {
WASM_UNREACHABLE("bad gc type");
}