Skip to content

Commit b0b8d3e

Browse files
[MeteSchedule] Bugfix: Add checks for nullable run_secs (#13790)
Runner sec is an Optional ObjectRef, so we need to check it's defined before we access its value.
1 parent fe01c5a commit b0b8d3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/meta_schedule/measure_callback/update_cost_model.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class UpdateCostModelNode : public MeasureCallbackNode {
4444
for (int i = 0; i < n; i++) {
4545
if (!builder_results[i]->error_msg.defined() && //
4646
(runner_results[i]->error_msg.defined() || //
47-
Sum(runner_results[i]->run_secs.value()) > 0)) {
47+
(runner_results[i]->run_secs.defined() &&
48+
Sum(runner_results[i]->run_secs.value()) > 0))) {
4849
pruned_candidate.push_back(measure_candidates[i]);
4950
pruned_runner_result.push_back(runner_results[i]);
5051
}

0 commit comments

Comments
 (0)