Skip to content

Commit 7b53017

Browse files
committed
address comments
1 parent e17c424 commit 7b53017

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

src/tools/fuzzing/fuzzing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2814,7 +2814,7 @@ Expression* TranslateToFuzzReader::makeStringConcat() {
28142814
}
28152815

28162816
Expression* TranslateToFuzzReader::makeStringSlice() {
2817-
auto* ref = make(Type(HeapType::string, getNullability()));
2817+
auto* ref = makeTrappingRefUse(HeapType::string);
28182818
auto* start = make(Type::i32);
28192819
auto* end = make(Type::i32);
28202820
return builder.makeStringSliceWTF(ref, start, end);
@@ -2845,7 +2845,7 @@ Expression* TranslateToFuzzReader::makeStringMeasure(Type type) {
28452845
Expression* TranslateToFuzzReader::makeStringGet(Type type) {
28462846
assert(type == Type::i32);
28472847

2848-
auto* ref = make(Type(HeapType::string, getNullability()));
2848+
auto* ref = makeTrappingRefUse(HeapType::string);
28492849
auto* pos = make(Type::i32);
28502850
return builder.makeStringWTF16Get(ref, pos);
28512851
}

src/wasm/wasm-stack.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,8 @@ InsertOrderedMap<Type, Index> BinaryInstWriter::countScratchLocals() {
26532653
if (curr->type == Type::unreachable) {
26542654
return;
26552655
}
2656+
// Scratch local to hold the `pos` value while we emit a stringview
2657+
// conversion for the `ref` value.
26562658
auto& count = scratches[Type::i32];
26572659
count = std::max(count, 1u);
26582660
}
@@ -2661,6 +2663,8 @@ InsertOrderedMap<Type, Index> BinaryInstWriter::countScratchLocals() {
26612663
if (curr->type == Type::unreachable) {
26622664
return;
26632665
}
2666+
// Scratch locals to hold the `start` and `end` values while we emit a
2667+
// stringview conversion for the `ref` value.
26642668
auto& count = scratches[Type::i32];
26652669
count = std::max(count, 2u);
26662670
}

test/binaryen.js/kitchen-sink.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,8 @@ function test_ids() {
179179
console.log("StringEncode: " + binaryen.StringEncodeId);
180180
console.log("StringConcat: " + binaryen.StringConcatId);
181181
console.log("StringEq: " + binaryen.StringEqId);
182-
console.log("StringAs: " + binaryen.StringAsId);
183-
console.log("StringWTF8Advance: " + binaryen.StringWTF8AdvanceId);
184182
console.log("StringWTF16Get: " + binaryen.StringWTF16GetId);
185-
console.log("StringIterNext: " + binaryen.StringIterNextId);
186-
console.log("StringIterMove: " + binaryen.StringIterMoveId);
187183
console.log("StringSliceWTF: " + binaryen.StringSliceWTFId);
188-
console.log("StringSliceIter: " + binaryen.StringSliceIterId);
189184
}
190185

191186
function test_core() {

test/binaryen.js/kitchen-sink.js.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,8 @@ StringMeasure: 81
109109
StringEncode: 82
110110
StringConcat: 83
111111
StringEq: 84
112-
StringAs: undefined
113-
StringWTF8Advance: undefined
114112
StringWTF16Get: 85
115-
StringIterNext: undefined
116-
StringIterMove: undefined
117113
StringSliceWTF: 86
118-
StringSliceIter: undefined
119114
getExpressionInfo={"id":15,"type":4,"op":6}
120115
(f32.neg
121116
(f32.const -33.61199951171875)

0 commit comments

Comments
 (0)