Skip to content

Commit

Permalink
unittest: Avoid use-after-stack-free
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Jun 29, 2024
1 parent e879c67 commit 27a8d07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unittest/test_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ class Fixture
mock::MockBinaryParser* binary_parser;
mock::MockDisassembler* disassembler;

Database database;

private:
std::vector<std::unique_ptr<trompeloeil::expectation>> expectations;
};
Expand All @@ -95,6 +93,8 @@ TEST_CASE_FIXTURE(Fixture, "the database can resolve references")
auto insns = std::move(insn_pair.first);
auto insn_refs = std::move(insn_pair.second);

Database database;

/*
* 0 sym: add $1, %eax
* 1 jmp 3 // Forward branch
Expand Down

0 comments on commit 27a8d07

Please sign in to comment.