changeset 920:7accd4546cf9

Fix memmem() signature; fix mono_reduce environment bookkeeping
author Adam Chlipala <adamc@hcoop.net>
date Tue, 08 Sep 2009 20:12:17 -0400
parents cc956020801b
children ae0110465421
files src/c/memmem.c src/mono_reduce.sml
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/memmem.c	Tue Sep 08 19:42:12 2009 -0400
+++ b/src/c/memmem.c	Tue Sep 08 20:12:17 2009 -0400
@@ -56,7 +56,7 @@
  * NULL if none is found.
  */
 void *
-memmem(const void *b1, const void *b2, size_t len1, size_t len2)
+memmem(const void *b1, size_t len1, const void *b2, size_t len2)
 {
         /* Initialize search pointer */
         char *sp = (char *) b1;
--- a/src/mono_reduce.sml	Tue Sep 08 19:42:12 2009 -0400
+++ b/src/mono_reduce.sml	Tue Sep 08 20:12:17 2009 -0400
@@ -474,7 +474,7 @@
                                                 foldl (fn (e, (body, remaining)) =>
                                                           (subExpInExp (0, multiLift remaining e) body, remaining - 1))
                                                       (body, length subs - 1) subs
-                                            val r = reduceExp env body
+                                            val r = reduceExp (E.patBinds env p) body
                                         in
                                             (*Print.preface ("subs", Print.p_list (MonoPrint.p_exp env) subs);*)
                                             (*Print.prefaces "ECase"
@@ -510,7 +510,8 @@
                         if impure env e' then
                             e
                         else
-                            EAbs (x', t', ran, reduceExp env (ELet (x, t, liftExpInExp 0 e', swapExpVars 0 e''), loc))
+                            EAbs (x', t', ran, reduceExp (E.pushERel env x' t' NONE)
+                                                         (ELet (x, t, liftExpInExp 0 e', swapExpVars 0 e''), loc))
 
                       | ELet (x, t, e', b) =>
                         let