mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2025-02-25 01:03:37 +00:00
spirv-fuzz: Apply fuzzer pass before checking exit conditions (#4199)
Fixes #4198.
This commit is contained in:
parent
a611be7782
commit
a732e4c03c
@ -282,6 +282,12 @@ Fuzzer::Result Fuzzer::Run(uint32_t num_of_transformations_to_apply) {
|
||||
|
||||
auto status = Status::kComplete;
|
||||
do {
|
||||
if (!ApplyPassAndCheckValidity(
|
||||
repeated_pass_manager_->ChoosePass(transformation_sequence_out_))) {
|
||||
status = Status::kFuzzerPassLedToInvalidModule;
|
||||
break;
|
||||
}
|
||||
|
||||
// Check that the module is small enough.
|
||||
if (ir_context_->module()->id_bound() >=
|
||||
fuzzer_context_->GetIdBoundLimit()) {
|
||||
@ -301,7 +307,9 @@ Fuzzer::Result Fuzzer::Run(uint32_t num_of_transformations_to_apply) {
|
||||
break;
|
||||
}
|
||||
|
||||
// If the number of transformations is still small
|
||||
// Check that we've not got stuck (this can happen if the only available
|
||||
// fuzzer passes are not able to apply any transformations, or can only
|
||||
// apply very few transformations).
|
||||
if (num_repeated_passes_applied_ >=
|
||||
fuzzer_context_->GetTransformationLimit()) {
|
||||
status = Status::kFuzzerStuck;
|
||||
@ -317,11 +325,6 @@ Fuzzer::Result Fuzzer::Run(uint32_t num_of_transformations_to_apply) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ApplyPassAndCheckValidity(
|
||||
repeated_pass_manager_->ChoosePass(transformation_sequence_out_))) {
|
||||
status = Status::kFuzzerPassLedToInvalidModule;
|
||||
break;
|
||||
}
|
||||
} while (ShouldContinueRepeatedPasses(num_of_transformations_to_apply == 0));
|
||||
|
||||
if (status != Status::kFuzzerPassLedToInvalidModule) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user