Letstmt analysis bug fix#6
Conversation
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/transform/auto_schedule.cc`:
- Line 1288: The call to GatherTaskNodes({wrapper->task, wrapper->child},
origin_children) can pass a null shared_ptr from WrapperNode::child and lead to
a crash; replace it with the wrapper-aware helper GatherTaskNodesSingle so null
children are handled safely (e.g., call GatherTaskNodesSingle(wrapper->task,
wrapper->child, origin_children)), and make the same replacement for the other
occurrence that mirrors this pattern (the second call around the later
occurrence).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: be73319b-5f2d-41c3-945d-2575636e0443
📒 Files selected for processing (1)
src/transform/auto_schedule.cc
| auto wrapper = static_cast<WrapperNode *>(ctrl->child.get()); | ||
| std::vector<std::shared_ptr<IRStructure>> origin_children; | ||
| GatherTaskNodes({wrapper->child}, origin_children); | ||
| GatherTaskNodes({wrapper->task, wrapper->child}, origin_children); |
There was a problem hiding this comment.
Use the wrapper-aware gather helper here.
GatherTaskNodes assumes every input entry is non-null, but WrapperNode::child is optional in this file's builder (see Lines 1508-1511 and 1526-1529). Constructing {wrapper->task, wrapper->child} can therefore feed a null shared_ptr into GatherTaskNodes and crash on the first dereference. Reusing GatherTaskNodesSingle(...) keeps the existing wrapper/null handling intact.
🛠️ Suggested fix
- GatherTaskNodes({wrapper->task, wrapper->child}, origin_children);
+ GatherTaskNodesSingle(ctrl->child, origin_children);- GatherTaskNodes({wrapper->task, wrapper->child}, origin_children);
+ GatherTaskNodesSingle(node, origin_children);Also applies to: 1312-1312
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/transform/auto_schedule.cc` at line 1288, The call to
GatherTaskNodes({wrapper->task, wrapper->child}, origin_children) can pass a
null shared_ptr from WrapperNode::child and lead to a crash; replace it with the
wrapper-aware helper GatherTaskNodesSingle so null children are handled safely
(e.g., call GatherTaskNodesSingle(wrapper->task, wrapper->child,
origin_children)), and make the same replacement for the other occurrence that
mirrors this pattern (the second call around the later occurrence).
d10b9dc
into
silentCoder-dev:auto-schedule
Summary by CodeRabbit
Release Notes