From bad3a7979cfcef65fa9be32dc72e03970fc4ad5f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 15 Mar 2013 16:08:55 -0600 Subject: [PATCH] fix parameter ordering in windows.cpp's MySystem::visit It's amazing to me that ebp and esp have been swapped for over three years without anybody noticing. It was dumb luck that the Trace test (which is designed to catch just such a thing) happened to fail when I ran the whole suite, and further investigation revealed that it was failing maybe five percent of the times it was run. Now we know why. --- src/vm/system/windows.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vm/system/windows.cpp b/src/vm/system/windows.cpp index 5c4a68cffd..9f9de4816e 100644 --- a/src/vm/system/windows.cpp +++ b/src/vm/system/windows.cpp @@ -775,12 +775,12 @@ class MySystem: public System { if (rv) { # ifdef ARCH_x86_32 visitor->visit(reinterpret_cast(context.Eip), - reinterpret_cast(context.Ebp), - reinterpret_cast(context.Esp)); + reinterpret_cast(context.Esp), + reinterpret_cast(context.Ebp)); # elif defined ARCH_x86_64 visitor->visit(reinterpret_cast(context.Rip), - reinterpret_cast(context.Rbp), - reinterpret_cast(context.Rsp)); + reinterpret_cast(context.Rsp), + reinterpret_cast(context.Rbp)); # endif success = true; }