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

Unified Diff: src/a64/simulator-a64.h

Issue 169223004: A64: Replace memcpy with reinterpret_cast assignment in simulator and decoder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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: src/a64/simulator-a64.h
diff --git a/src/a64/simulator-a64.h b/src/a64/simulator-a64.h
index 535f287096a317e9ce157b17c033f2184399d0ed..beac0c8f7546694c89f2d2e5a30a89e2ef6283a3 100644
--- a/src/a64/simulator-a64.h
+++ b/src/a64/simulator-a64.h
@@ -321,7 +321,7 @@ class Simulator : public DecoderVisitor {
template <typename T>
void set_pc(T new_pc) {
ASSERT(sizeof(T) == sizeof(pc_));
- memcpy(&pc_, &new_pc, sizeof(T));
+ *reinterpret_cast<T*>(&pc_) = new_pc;
pc_modified_ = true;
}
Instruction* pc() { return pc_; }

Powered by Google App Engine
This is Rietveld 408576698