[MLton-commit] r7368

Matthew Fluet fluet at mlton.org
Wed Dec 2 14:04:37 PST 2009


The function address of an indirect FFI call is not an argument to the
function.  This fixes a bug where the function address could be
allocated in a caller-save register and incorrectly evicted from the
register allocation, leading to the 'call' instruction attempting to
fetch the address from the uninitialized applyFFTempFun static
temporary variable.
----------------------------------------------------------------------

U   mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun
===================================================================
--- mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun	2009-12-02 22:04:24 UTC (rev 7367)
+++ mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun	2009-12-02 22:04:33 UTC (rev 7368)
@@ -186,7 +186,7 @@
   val applyFFTempFunContents 
     = makeContents {base = Immediate.label applyFFTempFun,
                     size = wordSize,
-                    class = Classes.CArg}
+                    class = Classes.CStatic}
   val applyFFTempFunContentsOperand
     = Operand.memloc applyFFTempFunContents
   val applyFFTempRegArg = Label.fromString "applyFFTempRegArg"




More information about the MLton-commit mailing list