@@ -3426,13 +3426,9 @@ Expression* TranslateToFuzzReader::makeBasicRef(Type type) {
3426
3426
// Choose a subtype we can materialize a constant for. We cannot
3427
3427
// materialize non-nullable refs to func or i31 in global contexts.
3428
3428
Nullability nullability = getSubType (type.getNullability ());
3429
- auto subtypeOpts = FeatureOptions<HeapType>().add (
3430
- FeatureSet::ReferenceTypes | FeatureSet::GC,
3431
- HeapType::i31,
3432
- HeapType::struct_,
3433
- HeapType::array);
3434
- auto subtype = pick (subtypeOpts).getBasic (share);
3435
- return makeConst (Type (subtype, nullability));
3429
+ assert (wasm.features .hasGC ());
3430
+ auto subtype = pick (HeapTypes::i31, HeapTypes::struct_, HeapTypes::array);
3431
+ return makeConst (Type (subtype.getBasic (share), nullability));
3436
3432
}
3437
3433
case HeapType::eq: {
3438
3434
if (!wasm.features .hasGC ()) {
@@ -5406,16 +5402,18 @@ HeapType TranslateToFuzzReader::getSubType(HeapType type) {
5406
5402
switch (type.getBasic (Unshared)) {
5407
5403
case HeapType::func:
5408
5404
// TODO: Typed function references.
5405
+ assert (wasm.features .hasReferenceTypes ());
5409
5406
return pick (FeatureOptions<HeapType>()
5410
- .add (FeatureSet::ReferenceTypes, HeapType ::func)
5411
- .add (FeatureSet::GC, HeapType ::nofunc))
5407
+ .add (HeapTypes ::func)
5408
+ .add (FeatureSet::GC, HeapTypes ::nofunc))
5412
5409
.getBasic (share);
5413
5410
case HeapType::cont:
5414
5411
return pick (HeapTypes::cont, HeapTypes::nocont).getBasic (share);
5415
5412
case HeapType::ext: {
5413
+ assert (wasm.features .hasReferenceTypes ());
5416
5414
auto options = FeatureOptions<HeapType>()
5417
- .add (FeatureSet::ReferenceTypes, HeapType ::ext)
5418
- .add (FeatureSet::GC, HeapType ::noext);
5415
+ .add (HeapTypes ::ext)
5416
+ .add (FeatureSet::GC, HeapTypes ::noext);
5419
5417
if (share == Unshared) {
5420
5418
// Shared strings not yet supported.
5421
5419
options.add (FeatureSet::Strings, HeapType::string);
@@ -5425,14 +5423,13 @@ HeapType TranslateToFuzzReader::getSubType(HeapType type) {
5425
5423
case HeapType::any: {
5426
5424
assert (wasm.features .hasReferenceTypes ());
5427
5425
assert (wasm.features .hasGC ());
5428
- auto options = FeatureOptions<HeapType>().add (FeatureSet::GC,
5429
- HeapType::any,
5430
- HeapType::eq,
5431
- HeapType::i31,
5432
- HeapType::struct_,
5433
- HeapType::array,
5434
- HeapType::none);
5435
- return pick (options).getBasic (share);
5426
+ return pick (HeapTypes::any,
5427
+ HeapTypes::eq,
5428
+ HeapTypes::i31,
5429
+ HeapTypes::struct_,
5430
+ HeapTypes::array,
5431
+ HeapTypes::none)
5432
+ .getBasic (share);
5436
5433
}
5437
5434
case HeapType::eq:
5438
5435
assert (wasm.features .hasReferenceTypes ());
0 commit comments