Reviewers: William Hesse,

Message:
Tiny review.

Description:
X64: Fix bug that reads from rax instead of correct register.
Crashes if rax doesn't point to readable memory.
Recent change made rax contain garbage due to write-barrier computation.
(The fact that it hasn't crashed before highly suggests that the line does
nothing.)

Please review this at http://codereview.chromium.org/545117

Affected files:
  M src/x64/macro-assembler-x64.cc


Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 3cf0836985bde3c909d2ad587cd75e117432ba86..65a408b48bc3d466a72217d48d500a9cf559d3ed 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -2418,7 +2418,7 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
     // Move up the chain of contexts to the context containing the slot.
     movq(dst, Operand(rsi, Context::SlotOffset(Context::CLOSURE_INDEX)));
     // Load the function context (which is the incoming, outer context).
-    movq(rax, FieldOperand(rax, JSFunction::kContextOffset));
+    movq(dst, FieldOperand(dst, JSFunction::kContextOffset));
     for (int i = 1; i < context_chain_length; i++) {
       movq(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
       movq(dst, FieldOperand(dst, JSFunction::kContextOffset));


-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to