[MLton-commit] r7132

Matthew Fluet fluet at mlton.org
Wed Jun 10 20:23:53 PDT 2009


Symbol scopes for indirect imports are not allowed.
----------------------------------------------------------------------

U   mlton/trunk/mlton/elaborate/elaborate-core.fun

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

Modified: mlton/trunk/mlton/elaborate/elaborate-core.fun
===================================================================
--- mlton/trunk/mlton/elaborate/elaborate-core.fun	2009-06-11 03:23:48 UTC (rev 7131)
+++ mlton/trunk/mlton/elaborate/elaborate-core.fun	2009-06-11 03:23:51 UTC (rev 7132)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -959,17 +960,26 @@
                val symbolScope =
                   List.keepAll (attributes, isIEAttributeSymbolScope)
                val symbolScope =
-                  case parseIEAttributesSymbolScope
-                       (symbolScope, SymbolScope.External) of
-                     NONE => (invalidAttributes ()
-                              ; SymbolScope.External)
-                   | SOME s => s
-               val () =
                   case name of
-                     NONE => ()
-                   | SOME x => scopeCheck {name = x,
-                                           symbolScope = symbolScope,
-                                           region = region}
+                     NONE =>
+                        (if List.isEmpty symbolScope
+                            then ()
+                            else invalidAttributes ()
+                         ; SymbolScope.External)
+                   | SOME name =>
+                        let
+                           val symbolScope =
+                              case parseIEAttributesSymbolScope
+                                   (symbolScope, SymbolScope.External) of
+                                 NONE => (invalidAttributes ()
+                                          ; SymbolScope.External)
+                               | SOME s => s
+                           val () = scopeCheck {name = name,
+                                                symbolScope = symbolScope,
+                                                region = region}
+                        in
+                           symbolScope
+                        end
                val addrTy = Type.cpointer
                val func =
                   CFunction.T {args = let




More information about the MLton-commit mailing list