@@ -390,7 +390,6 @@ std::optional<NodeInfo> ConsumeNodeStable(MsCtx script_ctx, FuzzedDataProvider&
390
390
bool allow_K = (type_needed == " " _mst) || (type_needed << " K" _mst);
391
391
bool allow_V = (type_needed == " " _mst) || (type_needed << " V" _mst);
392
392
bool allow_W = (type_needed == " " _mst) || (type_needed << " W" _mst);
393
- static constexpr auto B{" B" _mst}, K{" K" _mst}, V{" V" _mst}, W{" W" _mst};
394
393
395
394
switch (provider.ConsumeIntegral <uint8_t >()) {
396
395
case 0 :
@@ -440,22 +439,22 @@ std::optional<NodeInfo> ConsumeNodeStable(MsCtx script_ctx, FuzzedDataProvider&
440
439
}
441
440
case 11 :
442
441
if (!(allow_B || allow_K || allow_V)) return {};
443
- return {{{B , type_needed, type_needed}, Fragment::ANDOR}};
442
+ return {{{" B " _mst , type_needed, type_needed}, Fragment::ANDOR}};
444
443
case 12 :
445
444
if (!(allow_B || allow_K || allow_V)) return {};
446
- return {{{V , type_needed}, Fragment::AND_V}};
445
+ return {{{" V " _mst , type_needed}, Fragment::AND_V}};
447
446
case 13 :
448
447
if (!allow_B) return {};
449
- return {{{B, W }, Fragment::AND_B}};
448
+ return {{{" B " _mst, " W " _mst }, Fragment::AND_B}};
450
449
case 15 :
451
450
if (!allow_B) return {};
452
- return {{{B, W }, Fragment::OR_B}};
451
+ return {{{" B " _mst, " W " _mst }, Fragment::OR_B}};
453
452
case 16 :
454
453
if (!allow_V) return {};
455
- return {{{B, V }, Fragment::OR_C}};
454
+ return {{{" B " _mst, " V " _mst }, Fragment::OR_C}};
456
455
case 17 :
457
456
if (!allow_B) return {};
458
- return {{{B, B }, Fragment::OR_D}};
457
+ return {{{" B " _mst, " B " _mst }, Fragment::OR_D}};
459
458
case 18 :
460
459
if (!(allow_B || allow_K || allow_V)) return {};
461
460
return {{{type_needed, type_needed}, Fragment::OR_I}};
@@ -472,25 +471,25 @@ std::optional<NodeInfo> ConsumeNodeStable(MsCtx script_ctx, FuzzedDataProvider&
472
471
}
473
472
case 20 :
474
473
if (!allow_W) return {};
475
- return {{{B }, Fragment::WRAP_A}};
474
+ return {{{" B " _mst }, Fragment::WRAP_A}};
476
475
case 21 :
477
476
if (!allow_W) return {};
478
- return {{{B }, Fragment::WRAP_S}};
477
+ return {{{" B " _mst }, Fragment::WRAP_S}};
479
478
case 22 :
480
479
if (!allow_B) return {};
481
- return {{{K }, Fragment::WRAP_C}};
480
+ return {{{" K " _mst }, Fragment::WRAP_C}};
482
481
case 23 :
483
482
if (!allow_B) return {};
484
- return {{{V }, Fragment::WRAP_D}};
483
+ return {{{" V " _mst }, Fragment::WRAP_D}};
485
484
case 24 :
486
485
if (!allow_V) return {};
487
- return {{{B }, Fragment::WRAP_V}};
486
+ return {{{" B " _mst }, Fragment::WRAP_V}};
488
487
case 25 :
489
488
if (!allow_B) return {};
490
- return {{{B }, Fragment::WRAP_J}};
489
+ return {{{" B " _mst }, Fragment::WRAP_J}};
491
490
case 26 :
492
491
if (!allow_B) return {};
493
- return {{{B }, Fragment::WRAP_N}};
492
+ return {{{" B " _mst }, Fragment::WRAP_N}};
494
493
case 27 : {
495
494
if (!allow_B || !IsTapscript (script_ctx)) return {};
496
495
const auto k = provider.ConsumeIntegral <uint16_t >();
@@ -528,23 +527,20 @@ struct SmartInfo
528
527
{
529
528
/* Construct a set of interesting type requirements to reason with (sections of BKVWzondu). */
530
529
std::vector<Type> types;
531
- static constexpr auto B_mst{" B" _mst}, K_mst{" K" _mst}, V_mst{" V" _mst}, W_mst{" W" _mst};
532
- static constexpr auto d_mst{" d" _mst}, n_mst{" n" _mst}, o_mst{" o" _mst}, u_mst{" u" _mst}, z_mst{" z" _mst};
533
- static constexpr auto NONE_mst{" " _mst};
534
530
for (int base = 0 ; base < 4 ; ++base) { /* select from B,K,V,W */
535
- Type type_base = base == 0 ? B_mst : base == 1 ? K_mst : base == 2 ? V_mst : W_mst ;
531
+ Type type_base = base == 0 ? " B " _mst : base == 1 ? " K " _mst : base == 2 ? " V " _mst : " W " _mst ;
536
532
for (int zo = 0 ; zo < 3 ; ++zo) { /* select from z,o,(none) */
537
- Type type_zo = zo == 0 ? z_mst : zo == 1 ? o_mst : NONE_mst ;
533
+ Type type_zo = zo == 0 ? " z " _mst : zo == 1 ? " o " _mst : " " _mst ;
538
534
for (int n = 0 ; n < 2 ; ++n) { /* select from (none),n */
539
535
if (zo == 0 && n == 1 ) continue ; /* z conflicts with n */
540
536
if (base == 3 && n == 1 ) continue ; /* W conflicts with n */
541
- Type type_n = n == 0 ? NONE_mst : n_mst ;
537
+ Type type_n = n == 0 ? " " _mst : " n " _mst ;
542
538
for (int d = 0 ; d < 2 ; ++d) { /* select from (none),d */
543
539
if (base == 2 && d == 1 ) continue ; /* V conflicts with d */
544
- Type type_d = d == 0 ? NONE_mst : d_mst ;
540
+ Type type_d = d == 0 ? " " _mst : " d " _mst ;
545
541
for (int u = 0 ; u < 2 ; ++u) { /* select from (none),u */
546
542
if (base == 2 && u == 1 ) continue ; /* V conflicts with u */
547
- Type type_u = u == 0 ? NONE_mst : u_mst ;
543
+ Type type_u = u == 0 ? " " _mst : " u " _mst ;
548
544
Type type = type_base | type_zo | type_n | type_d | type_u;
549
545
types.push_back (type);
550
546
}
@@ -686,7 +682,7 @@ struct SmartInfo
686
682
/* Find which types are useful. The fuzzer logic only cares about constructing
687
683
* B,V,K,W nodes, so any type that isn't needed in any recipe (directly or
688
684
* indirectly) for the construction of those is uninteresting. */
689
- std::set<Type> useful_types{B_mst, V_mst, K_mst, W_mst };
685
+ std::set<Type> useful_types{" B " _mst, " V " _mst, " K " _mst, " W " _mst };
690
686
// Find the transitive closure by adding types until the set of types does not change.
691
687
while (true ) {
692
688
size_t set_size = useful_types.size ();
0 commit comments