testmasm crashes in testBranchTruncateDoubleToInt32() on ARM64
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2018 01:46:23 +0000 (01:46 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2018 01:46:23 +0000 (01:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183488

Reviewed by Mark Lam.

Using stackAlignmentBytes() will keep the stack properly aligned.

* assembler/testmasm.cpp:
(JSC::testBranchTruncateDoubleToInt32):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229446 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/testmasm.cpp

index 36b35a0..188e5b5 100644 (file)
@@ -1,5 +1,17 @@
 2018-03-08  Michael Saboff  <msaboff@apple.com>
 
+        testmasm crashes in testBranchTruncateDoubleToInt32() on ARM64
+        https://bugs.webkit.org/show_bug.cgi?id=183488
+
+        Reviewed by Mark Lam.
+
+        Using stackAlignmentBytes() will keep the stack properly aligned.
+
+        * assembler/testmasm.cpp:
+        (JSC::testBranchTruncateDoubleToInt32):
+
+2018-03-08  Michael Saboff  <msaboff@apple.com>
+
         Emit code to zero the stack frame on function entry
         Nhttps://bugs.webkit.org/show_bug.cgi?id=183391
 
index cc6b106..07e8817 100644 (file)
@@ -32,6 +32,7 @@
 #include "InitializeThreading.h"
 #include "LinkBuffer.h"
 #include "ProbeContext.h"
+#include "StackAlignment.h"
 #include <limits>
 #include <wtf/Compiler.h>
 #include <wtf/DataLog.h>
@@ -198,7 +199,7 @@ void testBranchTruncateDoubleToInt32(double val, int32_t expected)
 #endif
     CHECK_EQ(compileAndRun<int>([&] (CCallHelpers& jit) {
         jit.emitFunctionPrologue();
-        jit.subPtr(CCallHelpers::TrustedImm32(8), MacroAssembler::stackPointerRegister);
+        jit.subPtr(CCallHelpers::TrustedImm32(stackAlignmentBytes()), MacroAssembler::stackPointerRegister);
         if (isBigEndian) {
             jit.store32(CCallHelpers::TrustedImm32(valAsUInt >> 32),
                 MacroAssembler::stackPointerRegister);
@@ -218,7 +219,7 @@ void testBranchTruncateDoubleToInt32(double val, int32_t expected)
         jit.move(CCallHelpers::TrustedImm32(0), GPRInfo::returnValueGPR);
 
         done.link(&jit);
-        jit.addPtr(CCallHelpers::TrustedImm32(8), MacroAssembler::stackPointerRegister);
+        jit.addPtr(CCallHelpers::TrustedImm32(stackAlignmentBytes()), MacroAssembler::stackPointerRegister);
         jit.emitFunctionEpilogue();
         jit.ret();
     }), expected);