File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,16 @@ DEFINE_PROTO_FUZZER(Contract const& _input)
66
66
// We don't care about EVM One failures other than EVMC_REVERT
67
67
solAssert (result->status_code != EVMC_REVERT, " Proto ABIv2 fuzzer: EVM One reverted" );
68
68
if (result->status_code == EVMC_SUCCESS)
69
- solAssert (
70
- EvmoneUtility::zeroWord (result->output_data , result->output_size ),
71
- " Proto ABIv2 fuzzer: ABIv2 coding failure found"
72
- );
69
+ if (!EvmoneUtility::zeroWord (result->output_data , result->output_size ))
70
+ {
71
+ solidity::bytes resultAsBytes;
72
+ for (size_t i = 0 ; i < result->output_size ; i++)
73
+ resultAsBytes.push_back (result->output_data [i]);
74
+ cout << solidity::util::toHex (resultAsBytes) << endl;
75
+ solAssert (
76
+ false ,
77
+ " Proto ABIv2 fuzzer: ABIv2 coding failure found"
78
+ );
79
+ }
73
80
}
74
81
}
Original file line number Diff line number Diff line change @@ -426,6 +426,10 @@ void ProtoConverter::appendTypedParamsExternal(
426
426
(" type" , qualifiedTypeString)
427
427
(" varName" , _varName)
428
428
.render ();
429
+ m_untypedParamsExternal << Whiskers (R"( <delimiter><varName>)" )
430
+ (" delimiter" , delimiterToString (_delimiter))
431
+ (" varName" , _varName)
432
+ .render ();
429
433
}
430
434
431
435
// Adds the qualifier "memory" to non-value parameter of an external function.
@@ -671,14 +675,19 @@ string ProtoConverter::calldataHelperFunctions()
671
675
return 0;
672
676
}
673
677
674
- function coder_calldata_external(<parameters_calldata>) external pure returns (uint) {
678
+ function coder_calldata_external(<parameters_calldata>) external view returns (uint) {
679
+ return this.coder_calldata_external_indirection(<untyped_parameters>);
680
+ }
681
+
682
+ function coder_calldata_external_indirection(<parameters_calldata>) external pure returns (uint) {
675
683
<equality_checks>
676
684
return 0;
677
685
}
678
686
)" )
679
687
(" parameters_memory" , typedParametersAsString (CalleeType::PUBLIC))
680
688
(" equality_checks" , equalityChecksAsString ())
681
689
(" parameters_calldata" , typedParametersAsString (CalleeType::EXTERNAL))
690
+ (" untyped_parameters" , m_untypedParamsExternal.str ())
682
691
.render ();
683
692
684
693
return calldataHelperFuncs.str ();
Original file line number Diff line number Diff line change @@ -390,6 +390,8 @@ class ProtoConverter
390
390
// / Contains typed parameter list to be passed to callee functions
391
391
std::ostringstream m_typedParamsExternal;
392
392
std::ostringstream m_typedParamsPublic;
393
+ // / Contains parameter list to be passed to callee functions
394
+ std::ostringstream m_untypedParamsExternal;
393
395
// / Contains type string to be passed to Isabelle API
394
396
std::ostringstream m_isabelleTypeString;
395
397
// / Contains values to be encoded in the format accepted
You can’t perform that action at this time.
0 commit comments