File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,18 @@ Result<executorch_flatbuffer::ExecutionPlan*> get_execution_plan(
172
172
// only offset, the constant segment is empty and does not need to be loaded.
173
173
const auto * constant_segment = flatbuffer_program->constant_segment ();
174
174
if (constant_segment != nullptr && constant_segment->offsets () != nullptr &&
175
- constant_segment->offsets ()->size () > 1 ) {
175
+ constant_segment->offsets ()->size () > 0 ) {
176
+ if (constant_segment->offsets ()->size () == 1 ) {
177
+ // No constants; the constant segment is empty and does not
178
+ // need to be loaded.
179
+ return Program (
180
+ loader,
181
+ segment_base_offset,
182
+ std::move (program_data.get ()),
183
+ flatbuffer_program,
184
+ /* constant_segment_data=*/ FreeableBuffer{},
185
+ std::move (pte_data_map));
186
+ }
176
187
// The constant data is inside a separate segment.
177
188
const auto * constant_buffer = flatbuffer_program->constant_buffer ();
178
189
ET_CHECK_OR_RETURN_ERROR (
You can’t perform that action at this time.
0 commit comments