File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,7 @@ class TranslateToFuzzReader {
487487 // used in a place that will trap on null. For example, the reference of a
488488 // struct.get or array.set would use this.
489489 Expression* makeTrappingRefUse (HeapType type);
490+ Expression* makeTrappingRefUse (Type type);
490491
491492 Expression* buildUnary (const UnaryArgs& args);
492493 Expression* makeUnary (Type type);
Original file line number Diff line number Diff line change @@ -3955,7 +3955,7 @@ Expression* TranslateToFuzzReader::makeCompoundRef(Type type) {
39553955 }
39563956 Expression* descriptor = nullptr ;
39573957 if (auto descType = heapType.getDescriptorType ()) {
3958- descriptor = make (Type (*descType, Nullable, Exact));
3958+ descriptor = makeTrappingRefUse (Type (*descType, Nullable, Exact));
39593959 }
39603960 return builder.makeStructNew (heapType, values, descriptor);
39613961 }
@@ -4079,13 +4079,17 @@ Expression* TranslateToFuzzReader::makeStringGet(Type type) {
40794079}
40804080
40814081Expression* TranslateToFuzzReader::makeTrappingRefUse (HeapType type) {
4082+ return makeTrappingRefUse (Type (type, Nullable));
4083+ }
4084+
4085+ Expression* TranslateToFuzzReader::makeTrappingRefUse (Type type) {
40824086 auto percent = upTo (100 );
40834087 // Only give a low probability to emit a nullable reference.
40844088 if (percent < 5 ) {
4085- return make (Type ( type, Nullable));
4089+ return make (type. with ( Nullable));
40864090 }
40874091 // Otherwise, usually emit a non-nullable one.
4088- auto nonNull = Type ( type, NonNullable);
4092+ auto nonNull = type. with ( NonNullable);
40894093 if (percent < 70 || !funcContext) {
40904094 return make (nonNull);
40914095 }
You can’t perform that action at this time.
0 commit comments