Skip to content

Commit

Permalink
Update conformance suite to latest (vbpf#574)
Browse files Browse the repository at this point in the history
* Update bpf_conformance to latest
* Remove movsx imm tests since movsx is only defined for register operands per latest mailing list discussion
* Run new test cases added to conformance suite
* Fix conformance bug
---------

Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler authored Jan 25, 2024
1 parent e8047ca commit f3964ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/crab/ebpf_domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2751,7 +2751,11 @@ void ebpf_domain_t::operator()(const Bin& bin) {
default: break;
}
});
havoc(dst.type);
if ((bin.dst.v != std::get<Reg>(bin.v).v) || (type_inv.get_type(m_inv, dst.type) == T_UNINIT)) {
// Only forget the destination type if we're copying from a different register,
// or from the same uninitialized register.
havoc(dst.type);
}
type_inv.assign_type(m_inv, bin.dst, std::get<Reg>(bin.v));
break;
}
Expand Down
6 changes: 1 addition & 5 deletions src/test/test_conformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ TEST_CONFORMANCE("jeq-reg.data")
TEST_CONFORMANCE("jeq32-imm.data")
TEST_CONFORMANCE("jeq32-reg.data")
TEST_CONFORMANCE("jge-imm.data")
TEST_CONFORMANCE("jge-reg.data")
TEST_CONFORMANCE("jge32-imm.data")
TEST_CONFORMANCE("jge32-reg.data")
TEST_CONFORMANCE("jgt-imm.data")
Expand Down Expand Up @@ -185,15 +186,10 @@ TEST_CONFORMANCE("mod64-by-zero-reg.data")
TEST_CONFORMANCE("mod64.data")
TEST_CONFORMANCE("mov.data")
TEST_CONFORMANCE("mov64-sign-extend.data")
TEST_CONFORMANCE("movsx1632-imm.data")
TEST_CONFORMANCE("movsx1632-reg.data")
TEST_CONFORMANCE("movsx1664-imm.data")
TEST_CONFORMANCE("movsx1664-reg.data")
TEST_CONFORMANCE("movsx3264-imm.data")
TEST_CONFORMANCE("movsx3264-reg.data")
TEST_CONFORMANCE("movsx832-imm.data")
TEST_CONFORMANCE("movsx832-reg.data")
TEST_CONFORMANCE("movsx864-imm.data")
TEST_CONFORMANCE("movsx864-reg.data")
TEST_CONFORMANCE("mul32-imm.data")
TEST_CONFORMANCE("mul32-reg-overflow.data")
Expand Down

0 comments on commit f3964ef

Please sign in to comment.