diff options
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r-- | src/wasm-builder.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 324ed6fd2..5592273da 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -1153,6 +1153,14 @@ public: if (type.isRef() && type.getHeapType() == HeapType::i31) { return makeI31New(makeConst(value.geti31())); } + if (type.isString()) { + // TODO: more than ascii support + std::string string; + for (auto c : value.getGCData()->values) { + string.push_back(c.getInteger()); + } + return makeStringConst(string); + } TODO_SINGLE_COMPOUND(type); WASM_UNREACHABLE("unsupported constant expression"); } |