fix some duplication in object tables
authorAndy Wingo <wingo@pobox.com>
Sun, 8 May 2011 20:55:05 +0000 (22:55 +0200)
committerAndy Wingo <wingo@pobox.com>
Sun, 8 May 2011 20:55:05 +0000 (22:55 +0200)
* module/language/glil/compile-assembly.scm (build-object-table): Don't
  add the same value to an object table twice.

module/language/glil/compile-assembly.scm

index d02b903..a081822 100644 (file)
 ;;
 (define (build-object-table x)
   (define (add store x)
-    (vhash-cons x (1+ (vlist-length store)) store))
+    (if (vhash-assoc x store)
+        store
+        (vhash-cons x (1+ (vlist-length store)) store)))
   (record-case x
     ((<glil-program> meta body)
      (fold (lambda (x table)