From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.bugs Subject: with-fluids bug? Date: Sun, 26 Sep 2010 22:44:31 +0200 Message-ID: <201009262244.32030.stefan.tampe@spray.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_wC7nMsp/y2F9RH3" X-Trace: dough.gmane.org 1285533966 24149 80.91.229.12 (26 Sep 2010 20:46:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Sep 2010 20:46:06 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Sep 26 22:46:05 2010 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ozy6k-0002ta-Kj for guile-bugs@m.gmane.org; Sun, 26 Sep 2010 22:46:02 +0200 Original-Received: from localhost ([127.0.0.1]:60563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozy6j-0007vO-Tt for guile-bugs@m.gmane.org; Sun, 26 Sep 2010 16:46:01 -0400 Original-Received: from [140.186.70.92] (port=52858 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozy6a-0007uZ-To for bug-guile@gnu.org; Sun, 26 Sep 2010 16:45:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ozy6Z-0006Sd-Pj for bug-guile@gnu.org; Sun, 26 Sep 2010 16:45:52 -0400 Original-Received: from spsmtp02oc.mail2world.com ([74.202.142.198]:1177) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ozy6Z-0006Il-La for bug-guile@gnu.org; Sun, 26 Sep 2010 16:45:51 -0400 Original-Received: from mail pickup service by spsmtp02oc.mail2world.com with Microsoft SMTPSVC; Sun, 26 Sep 2010 13:44:19 -0700 auth-sender: stefan.tampe@spray.se Original-Received: from 82.182.254.46 unverified ([82.182.254.46]) by spsmtp02oc.mail2world.com with Mail2World SMTP Server; Sun, 26 Sep 2010 13:44:18 -0700 User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.2-desktop; KDE/4.4.4; x86_64; ; ) X-OriginalArrivalTime: 26 Sep 2010 20:44:19.0168 (UTC) FILETIME=[9777F600:01CB5DBB] X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4819 Archived-At: --Boundary-00=_wC7nMsp/y2F9RH3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Here follows an issue with resent head and a potential first start of a solution. Problem: (define a (make-fluid)) (with-fluids ((a 1)) 2) ; returns 2 (pk (with-fluids ((a 1)) 2)) ; barfs at trying to execute function 1 The issue: the wind-fluids instruction reads previouslyu pushed fluids and vals and set their value acordingly. But does just do a read and no pop! by simply adding sp -= 2*n, the code above works fine. Now, I'm not an expert at coding vm-instruction, there might be more to say here but a patch follows this mail. Regards Stefan --Boundary-00=_wC7nMsp/y2F9RH3 Content-Type: text/x-patch; charset="UTF-8"; name="with-dynwind-vm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="with-dynwind-vm.patch" diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 05c632c..1c5cafb 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -1582,6 +1582,7 @@ VM_DEFINE_INSTRUCTION (90, wind_fluids, "wind-fluids", 1, -1, 0) wf = scm_i_make_with_fluids (n, sp + 1 - 2*n, sp + 1 - n); scm_i_swap_with_fluids (wf, dynstate); scm_i_set_dynwinds (scm_cons (wf, scm_i_dynwinds ())); + sp -= 2*n; NEXT; } --Boundary-00=_wC7nMsp/y2F9RH3--