changeset 1438:b6df00ed536c

Fix soundness bug in Effectize, which lead to missing effects in event handlers
author Adam Chlipala <adam@chlipala.net>
date Fri, 18 Mar 2011 09:46:24 -0400
parents 493e087f5479
children 6ff10428de4a
files src/effectize.sml
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/effectize.sml	Fri Mar 18 09:12:55 2011 -0400
+++ b/src/effectize.sml	Fri Mar 18 09:46:24 2011 -0400
@@ -97,13 +97,13 @@
             case #1 d of
                 DVal (x, n, t, e, s) =>
                 let
-                    val e = dejs e
+                    val e' = dejs e
                 in
-                    (d, (if couldWrite writers e then
+                    (d, (if couldWrite writers e' then
                              IM.insert (writers, n, (#2 d, s))
                          else
                              writers,
-                         if couldReadCookie readers e then
+                         if couldReadCookie readers e' then
                              IM.insert (readers, n, (#2 d, s))
                          else
                              readers,
@@ -117,16 +117,16 @@
                     fun oneRound evs =
                         foldl (fn ((_, n, _, e, s), (changed, (writers, readers, pushers))) =>
                                   let
-                                      val e = dejs e
+                                      val e' = dejs e
 
                                       val (changed, writers) =
-                                          if couldWrite writers e andalso not (IM.inDomain (writers, n)) then
+                                          if couldWrite writers e' andalso not (IM.inDomain (writers, n)) then
                                               (true, IM.insert (writers, n, (#2 d, s)))
                                           else
                                               (changed, writers)
 
                                       val (changed, readers) =
-                                          if couldReadCookie readers e andalso not (IM.inDomain (readers, n)) then
+                                          if couldReadCookie readers e' andalso not (IM.inDomain (readers, n)) then
                                               (true, IM.insert (readers, n, (#2 d, s)))
                                           else
                                               (changed, readers)