Fix EbpfDomain::to_set() returning top instead of bottom#1093
Conversation
…ble states Fixes #1077 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Elazar Gershuni <elazarg@gmail.com>
📝 WalkthroughWalkthroughModified Changes
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test-data/jump.yaml (1)
601-611:⚠️ Potential issue | 🟠 MajorMissed update:
post: []still here despite unreachable message.This test case (Lines 601-611) has
messages: "0: Code becomes unreachable (assume r1 != r2)", which means the post-state is bottom — identical in shape to the neighbors that were flipped topost: ["_|_"]. Leavingpost: []here is inconsistent with the rest of the PR and, given the correctedEbpfDomain::to_set(), an emptypostlist now asserts the top invariant rather than bottom, so this case is no longer testing what itsmessagessay it tests.Side note: the test-case name
assume map_fd1 != map_fd2is also duplicated with Line 587. Worth disambiguating while you're here.Proposed fix
-post: [] +post: + - "_|_" messages: - "0: Code becomes unreachable (assume r1 != r2)"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test-data/jump.yaml` around lines 601 - 611, The test-case named "assume map_fd1 != map_fd2" has messages indicating the code becomes unreachable (bottom) but still uses post: [] which now denotes top after the EbpfDomain::to_set() change; update this test to set post: ["_|_"] (or otherwise represent bottom) to match the unreachable message, and also rename the duplicate test-case (the one at lines ~601) to a unique name to avoid collision with the other "assume map_fd1 != map_fd2" entry; ensure you modify the test-case's post field and its name consistently so the test asserts bottom as intended.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@test-data/jump.yaml`:
- Around line 601-611: The test-case named "assume map_fd1 != map_fd2" has
messages indicating the code becomes unreachable (bottom) but still uses post:
[] which now denotes top after the EbpfDomain::to_set() change; update this test
to set post: ["_|_"] (or otherwise represent bottom) to match the unreachable
message, and also rename the duplicate test-case (the one at lines ~601) to a
unique name to avoid collision with the other "assume map_fd1 != map_fd2" entry;
ensure you modify the test-case's post field and its name consistently so the
test asserts bottom as intended.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: f64b8003-ff47-4238-b3c0-fc65b552a2a5
📒 Files selected for processing (16)
src/crab/ebpf_domain.cpptest-data/assign.yamltest-data/atomic.yamltest-data/call.yamltest-data/callx.yamltest-data/jump.yamltest-data/loop.yamltest-data/movsx.yamltest-data/packet.yamltest-data/pointer.yamltest-data/sdivmod.yamltest-data/stack.yamltest-data/subtract.yamltest-data/udivmod.yamltest-data/uninit.yamltest-data/unsigned.yaml
Summary
EbpfDomain::to_set()returnedStringInvariant::top()when the domain is bottom (unreachable), instead ofStringInvariant::bottom().post: []= top) to the correctpost: ["_|_"](bottom).Fixes the last item in #1077
Test plan
🤖 Generated with Claude Code