Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: runtime/vm/instructions_ia32_test.cc

Issue 136563002: Landing: Write protect executable pages in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/instructions_ia32_test.cc
===================================================================
--- runtime/vm/instructions_ia32_test.cc (revision 31654)
+++ runtime/vm/instructions_ia32_test.cc (working copy)
@@ -7,8 +7,10 @@
#include "vm/assembler.h"
#include "vm/instructions.h"
+#include "vm/object.h"
#include "vm/stub_code.h"
#include "vm/unit_test.h"
+#include "vm/virtual_memory.h"
namespace dart {
@@ -35,6 +37,13 @@
ASSEMBLER_TEST_RUN(Jump, test) {
+ const Code& code = test->code();
+ const Instructions& instrs = Instructions::Handle(code.instructions());
+ bool status =
+ VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
+ instrs.size(),
+ VirtualMemory::kReadWriteExecute);
+ EXPECT(status);
JumpPattern jump1(test->entry(), test->code());
EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
jump1.TargetAddress());

Powered by Google App Engine
This is Rietveld 408576698