diff options
author | Andy Wingo <wingo@pobox.com> | 2011-05-05 14:09:29 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-05-05 14:09:29 +0200 |
commit | 891a1851a1e0e47560cf99cf76e9478d77e1a7db (patch) | |
tree | 8d00ba1b7f14b75005285d86abba3ea05b4f1767 /module/language/assembly.scm | |
parent | 1903eae4c9ab97b575dad4ab1f5cf05436d84ab3 (diff) | |
parent | eae2438d2bd1d9a0e0aaa052abb8b36b2d073850 (diff) | |
download | guile-891a1851a1e0e47560cf99cf76e9478d77e1a7db.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Diffstat (limited to 'module/language/assembly.scm')
-rw-r--r-- | module/language/assembly.scm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/module/language/assembly.scm b/module/language/assembly.scm index e119628da..ad8dead65 100644 --- a/module/language/assembly.scm +++ b/module/language/assembly.scm @@ -1,6 +1,6 @@ ;;; Guile Virtual Machine Assembly -;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -37,8 +37,8 @@ (define (byte-length assembly) (pmatch assembly - (,label (guard (not (pair? label))) - 0) + ((,inst . _) (guard (>= (instruction-length inst) 0)) + (+ 1 (instruction-length inst))) ((load-number ,str) (+ 1 *len-len* (string-length str))) ((load-string ,str) @@ -51,8 +51,8 @@ (+ 1 *len-len* (bytevector-length bv))) ((load-program ,labels ,len ,meta . ,code) (+ 1 *program-header-len* len (if meta (1- (byte-length meta)) 0))) - ((,inst . _) (guard (>= (instruction-length inst) 0)) - (+ 1 (instruction-length inst))) + (,label (guard (not (pair? label))) + 0) (else (error "unknown instruction" assembly)))) |