Skip to content

Commit ccf8913

Browse files
authored
Fix trunk ci (#18747)
### Summary The problem is: 1. In tests, Verification::InternalConsistency is requested. 2. In release builds, ET_ENABLE_PROGRAM_VERIFICATION=False. 3. #18597 returned a hard error when Verification::InternalConsistency was requested but not available (ie when 1 and 2 conflict) This PR reverts the hard error and falls back to Verification::Minimal when Verification::InternalConsistency is required but not available (e.g. in Release builds) ### Test plan CI
1 parent 1eaafd9 commit ccf8913

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

runtime/executor/program.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,20 @@ Result<executorch_flatbuffer::ExecutionPlan*> get_execution_plan(
179179
"Program validation failed: likely a corrupt file");
180180
#else
181181
ET_LOG(
182-
Error,
182+
Info,
183183
"InternalConsistency verification requested but not available; "
184-
"build with ET_ENABLE_PROGRAM_VERIFICATION=1");
185-
return Error::NotSupported;
184+
"falling back to Minimal verification. "
185+
"Build with ET_ENABLE_PROGRAM_VERIFICATION=1 for full verification.");
186186
#endif
187-
} else {
188-
// Verification::Minimal: Verify that the root table offset is within
189-
// bounds. This is done in InternalConsistency by VerifyProgramBuffer.
187+
}
188+
189+
if (verification == Verification::Minimal
190+
#if !ET_ENABLE_PROGRAM_VERIFICATION
191+
|| verification == Verification::InternalConsistency
192+
#endif
193+
) {
194+
// Verify that the root table offset is within bounds.
195+
// In InternalConsistency mode this is done by VerifyProgramBuffer above.
190196
uint32_t root_offset =
191197
flatbuffers::ReadScalar<flatbuffers::uoffset_t>(program_data->data());
192198
// The root table is at buf + root_offset. It must not point into the

0 commit comments

Comments
 (0)