| 440 | } // namespace |
| 441 | |
| 442 | spv_result_t ValidateBinaryAndKeepValidationState( |
| 443 | const spv_const_context context, spv_const_validator_options options, |
| 444 | const uint32_t* words, const size_t num_words, spv_diagnostic* pDiagnostic, |
| 445 | std::unique_ptr<ValidationState_t>* vstate) { |
| 446 | spv_context_t hijack_context = *context; |
| 447 | if (pDiagnostic) { |
| 448 | *pDiagnostic = nullptr; |
| 449 | UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); |
| 450 | } |
| 451 | |
| 452 | vstate->reset(new ValidationState_t(&hijack_context, options, words, |
| 453 | num_words, kDefaultMaxNumOfWarnings)); |
| 454 | |
| 455 | return ValidateBinaryUsingContextAndValidationState( |
| 456 | hijack_context, words, num_words, pDiagnostic, vstate->get()); |
| 457 | } |
| 458 | |
| 459 | } // namespace val |
| 460 | } // namespace spvtools |
no test coverage detected