bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bug #33325] using setIndirectDefines safely


From: tk
Subject: [Bug-kawa] [bug #33325] using setIndirectDefines safely
Date: Mon, 16 May 2011 16:44:16 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.53 Safari/534.30

URL:
  <http://savannah.gnu.org/bugs/?33325>

                 Summary: using setIndirectDefines safely
                 Project: Kawa
            Submitted by: huh
            Submitted on: Mon 16 May 2011 04:44:15 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: Unexpected result
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:


I'd like to suggest the following patch to allow one to make 
setting INDIRECT_DEFINES the default for new InheritingEnvironments.
It simply adds a static flag to gnu.mapping.InheritingEnvironment
to specify that setIndirectDefines be called in the constructor.

The rationale is that setting INDIRECT_DEFINES can only safely be 
done at the time the environment is created. Attempting to set this
flag later, in application code, can put the environment into an
inconsistent state (because of the way Kawa uses timestamps for
SharedLocations). For implicitly created environments (e.g. in futures),
the constructor is the safe place to do this.

I don't think I've thoroughly understood how Kawa uses these timestamps
for lookups, but this change takes care of a problem where symbol 
lookups were failing in some circumstances where setIndirectDefines is
called too late.


Index: gnu/mapping/ChangeLog
===================================================================
--- gnu/mapping/ChangeLog       (revision 6981)
+++ gnu/mapping/ChangeLog       (working copy)
@@ -1,3 +1,9 @@
+2011-05-16  thomas kirk  <address@hidden>
+
+       * InheritingEnvironment.java (DEFAULT_INDIRECT_DEFINES): New flag.
+       (constructor): call setIndirectDefines upon creation of environment
+       if DEFAULT_INDIRECT_DEFINES is true.
+
 2011-04-25  Charles Turner  <address@hidden>
            Per Bothner  <address@hidden>
 
Index: gnu/mapping/InheritingEnvironment.java
===================================================================
--- gnu/mapping/InheritingEnvironment.java      (revision 6981)
+++ gnu/mapping/InheritingEnvironment.java      (working copy)
@@ -9,6 +9,10 @@
   Environment[] inherited;
   int baseTimestamp;
 
+  /* true if newly created InheritingEnvironments should 
+     set INDIRECT_DEFINES by default */
+  public static boolean DEFAULT_INDIRECT_DEFINES = false;
+
   public InheritingEnvironment (String name, Environment parent)
   {
     super(name);
@@ -19,6 +23,9 @@
         baseTimestamp = timestamp;
         currentTimestamp = timestamp;
       }
+
+    if (DEFAULT_INDIRECT_DEFINES)
+      setIndirectDefines();
   }
 
   public final int getNumParents () { return numInherited; }





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33325>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]