Address comments I missed on a previous CL
I accidentally missed some comments on
android-review.googlesource.com/c/305518 when I submitted it. This
addresses those comments.
Test: mma -j40 test-art-host
Change-Id: Icd8ff65dee1730d10489f25e75bddbd455c68413
diff --git a/runtime/openjdkjvmti/ti_redefine.cc b/runtime/openjdkjvmti/ti_redefine.cc
index 69bd887..d0349b9 100644
--- a/runtime/openjdkjvmti/ti_redefine.cc
+++ b/runtime/openjdkjvmti/ti_redefine.cc
@@ -66,7 +66,8 @@
return map;
}
memcpy(map->Begin(), dex_data, data_len);
- // Make the dex files mmap read only.
+ // Make the dex files mmap read only. This matches how other DexFiles are mmaped and prevents
+ // programs from corrupting it.
map->Protect(PROT_READ);
return map;
}