[MLton-commit] r6672

Matthew Fluet fluet at mlton.org
Wed Jul 16 11:46:54 PDT 2008


Fixed bug in the name mangling of _import-ed functions with the stdcall convention.
----------------------------------------------------------------------

U   mlton/trunk/doc/changelog
U   mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun

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

Modified: mlton/trunk/doc/changelog
===================================================================
--- mlton/trunk/doc/changelog	2008-07-06 14:24:28 UTC (rev 6671)
+++ mlton/trunk/doc/changelog	2008-07-16 18:46:51 UTC (rev 6672)
@@ -1,5 +1,9 @@
 Here are the changes from version 20070826 to version YYYYMMDD.
 
+* 2008-07-16
+   - Fixed bug in the name mangling of _import-ed functions with the
+     stdcall convention.
+
 * 2008-06-06
    - Added expert command line switch -emit-main {true|false}.
 

Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun	2008-07-06 14:24:28 UTC (rev 6671)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun	2008-07-16 18:46:51 UTC (rev 6672)
@@ -1,4 +1,4 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -1187,7 +1187,7 @@
                              (AppendList.append (assembly_arg, assembly_args),
                               size_arg + size_args)
                           end)
-                     val (pushArgs, size_args) =
+                     val (pushArgs, aligned_size_args) =
                         let
                            val space = 16 - (size_args mod 16)
                         in
@@ -1374,13 +1374,13 @@
                         (Assembly.directive_return
                          {returns = Operand.cReturnTemps returnTy})
                      val fixCStack =
-                        if size_args > 0
+                        if aligned_size_args > 0
                            andalso convention = CFunction.Convention.Cdecl
                            then (AppendList.single
                                  (Assembly.instruction_binal
                                   {oper = Instruction.ADD,
                                    dst = c_stackP,
-                                   src = Operand.immediate_int size_args,
+                                   src = Operand.immediate_int aligned_size_args,
                                    size = pointerSize}))
                            else AppendList.empty
                      val continue




More information about the MLton-commit mailing list