| 492 | } |
| 493 | |
| 494 | spv_result_t spvValidateWithOptions(const spv_const_context context, |
| 495 | spv_const_validator_options options, |
| 496 | const spv_const_binary binary, |
| 497 | spv_diagnostic* pDiagnostic) { |
| 498 | spv_context_t hijack_context = *context; |
| 499 | if (pDiagnostic) { |
| 500 | *pDiagnostic = nullptr; |
| 501 | spvtools::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic); |
| 502 | } |
| 503 | |
| 504 | // Create the ValidationState using the context. |
| 505 | spvtools::val::ValidationState_t vstate(&hijack_context, options, |
| 506 | binary->code, binary->wordCount, |
| 507 | kDefaultMaxNumOfWarnings); |
| 508 | |
| 509 | return spvtools::val::ValidateBinaryUsingContextAndValidationState( |
| 510 | hijack_context, binary->code, binary->wordCount, pDiagnostic, &vstate); |
| 511 | } |
no test coverage detected