diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2020-05-02 00:42:29 +0200 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2020-08-24 19:31:32 +0200 |
| commit | 5b52b3e9cb74a04710edae2a571fe9b9fc5a3d1e (patch) | |
| tree | 8dbce5a78f1fe0ffd574661e5055aab9b1ad57b5 /Source/UnitTests/Common/x64EmitterTest.cpp | |
| parent | c36ae84b966327bd9d78d3eabf2309f82d37792e (diff) | |
x64Emitter: Check end of allocated space when emitting code.
Diffstat (limited to 'Source/UnitTests/Common/x64EmitterTest.cpp')
| -rw-r--r-- | Source/UnitTests/Common/x64EmitterTest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/UnitTests/Common/x64EmitterTest.cpp b/Source/UnitTests/Common/x64EmitterTest.cpp index 77006f211c..f4aa233904 100644 --- a/Source/UnitTests/Common/x64EmitterTest.cpp +++ b/Source/UnitTests/Common/x64EmitterTest.cpp @@ -93,6 +93,7 @@ protected: emitter.reset(new X64CodeBlock()); emitter->AllocCodeSpace(4096); code_buffer = emitter->GetWritableCodePtr(); + code_buffer_end = emitter->GetWritableCodeEnd(); disasm.reset(new disassembler); disasm->set_syntax_intel(); @@ -158,12 +159,13 @@ protected: EXPECT_EQ(expected_norm, disasmed_norm); // Reset code buffer afterwards. - emitter->SetCodePtr(code_buffer); + emitter->SetCodePtr(code_buffer, code_buffer_end); } std::unique_ptr<X64CodeBlock> emitter; std::unique_ptr<disassembler> disasm; u8* code_buffer; + u8* code_buffer_end; }; #define TEST_INSTR_NO_OPERANDS(Name, ExpectedDisasm) \ |
