# HG changeset patch # User Doug Simon # Date 1363006876 -3600 # Node ID 60a90f4334599706507c3e86aa8b468296aba7cd # Parent 75e8020ed0f5bc75e6b80c493b303517c20f1e09 alignment bug fix (contributed by Mick Jordan) diff -r 75e8020ed0f5 -r 60a90f433459 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java Mon Mar 11 12:07:28 2013 +0100 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java Mon Mar 11 14:01:16 2013 +0100 @@ -63,7 +63,10 @@ // make sure that the displacement word of the call ends up word aligned int offset = masm.codeBuffer.position(); offset += tasm.target.arch.getMachineCodeCallDisplacementOffset(); - masm.nop(tasm.target.wordSize - offset % tasm.target.wordSize); + int modulus = tasm.target.wordSize; + if (offset % modulus != 0) { + masm.nop(modulus - offset % modulus); + } } }