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

Unified Diff: runtime/vm/pages.cc

Issue 1635343002: Stop initializing code pages with RWX permissions (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Stop initializing code pages with RWX permissions Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 5d5df0e2d559398f7494b34059206646c3399233..02a566c1a256faf33b4333ca78a8ed27bc6b3975 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -50,7 +50,9 @@ HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) {
ASSERT(memory != NULL);
ASSERT(memory->size() > VirtualMemory::PageSize());
bool is_executable = (type == kExecutable);
- if (!memory->Commit(is_executable)) {
+ // Create the new page executable (RWX) only if we're not in W^X mode
+ bool create_executable = !FLAG_write_protect_code;
siva 2016/01/28 00:10:16 Shouldn't this be bool create_executable = !FLAG_
Todd Eisenberger 2016/01/28 00:21:05 Good catch; got caught up with finding the RWX lea
+ if (!memory->Commit(create_executable)) {
return NULL;
}
HeapPage* result = reinterpret_cast<HeapPage*>(memory->address());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698