Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package bff for openSUSE:Factory checked in at 2022-12-05 18:02:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bff (Old) and /work/SRC/openSUSE:Factory/.bff.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bff" Mon Dec 5 18:02:21 2022 rev:13 rq:1040344 version:1.0.7 Changes: -------- --- /work/SRC/openSUSE:Factory/bff/bff.changes 2018-06-13 15:39:35.688109108 +0200 +++ /work/SRC/openSUSE:Factory/.bff.new.1835/bff.changes 2022-12-05 18:02:42.925076340 +0100 @@ -1,0 +2,16 @@ +Mon Dec 5 15:29:37 UTC 2022 - Dirk Müller <dmuel...@suse.com> + +- update to 1.0.7: + * fixed an issue in preprocessing stage that caused it + to ingest more bf code than there was if the bf code + started with <<... or >>... sequence. This lead to a + heap corruption with variable consequences. + * added special handling for [-] and [+] +- readd groups tag + +------------------------------------------------------------------- +Thu Oct 17 14:34:20 UTC 2019 - Richard Brown <rbr...@suse.com> + +- Remove obsolete Groups tag (fate#326485) + +------------------------------------------------------------------- Old: ---- bff-1.0.5.tar.gz New: ---- bff-1.0.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bff.spec ++++++ --- /var/tmp/diff_new_pack.vtBUWo/_old 2022-12-05 18:02:43.313078454 +0100 +++ /var/tmp/diff_new_pack.vtBUWo/_new 2022-12-05 18:02:43.321078497 +0100 @@ -1,7 +1,7 @@ # # spec file for package bff # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,21 +12,21 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: bff -Version: 1.0.5 +Version: 1.0.7 Release: 0 -Summary: Slightly-optimizing Brainfuck interpreter +Summary: Moderately-optimizing Brainfuck interpreter License: BSD-3-Clause Group: Development/Languages/Other -Url: http://swapped.cc/bf/ +URL: https://swapped.cc/bff Source: https://github.com/apankrat/bff/archive/v%{version}/%{name}-%{version}.tar.gz %description -Slightly-optimizing (tm) Brainfuck interpreter +Moderately-optimizing (tm) Brainfuck interpreter %package samples Summary: Samples of code written in Brainfuck ++++++ bff-1.0.5.tar.gz -> bff-1.0.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bff-1.0.5/README.md new/bff-1.0.7/README.md --- old/bff-1.0.5/README.md 2012-12-10 10:17:00.000000000 +0100 +++ new/bff-1.0.7/README.md 2018-09-29 16:41:57.000000000 +0200 @@ -1,46 +1,56 @@ - bff 1.0.5 + bff 1.0.7 ========= - + Moderately-optimizing brainfuck interpreter - + http://swapped.cc/bff - + = To build with GNU tools run make - + To install in /usr/bin (not sure why you'd be wanting this though) make install - + To clean up the build files make clean - + = + 1.0.7 - Aug 09, 2018 + fixed an issue in preprocessing stage that caused it + to ingest more bf code than there was if the bf code + started with <<... or >>... sequence. This lead to a + heap corruption with variable consequences. kudos to + Alex Stefanov for reporting this. + + 1.0.6 - Apr 27, 2015 + added special handling for [-] and [+] + 1.0.5 - Dec 10, 2012 fixed grow() as per Mitch Schwartz note - 1.0.4 - Aug 1, 2011 + 1.0.4 - Aug 01, 2011 fixed xalloc() to zero newly allocated blocks - - 1.0.3.1 - Aug 2, 2004 + + 1.0.3.1 - Aug 02, 2004 fixed a bug where programs starting with < or > command were not handled properly - + 1.0.3 - Jul 29, 2004 further optimized the main loop, now runs twice as fast - + 1.0.2 - Apr 27, 2004 made it compilable under MSVC added -Wall to Makefile added missing string.h include - + 1.0.1 - Apr 27, 2004 the cell array is now dynamically grown when exhausted; the input may be read from the file - + 1.0.0 - Apr 26, 2004 an initial public release - + ========================================================================== Copyright (c) 2004-12, Alex Pankratov (a...@swapped.cc). All rights reserved. - + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bff-1.0.5/bff.c new/bff-1.0.7/bff.c --- old/bff-1.0.5/bff.c 2012-12-10 10:17:00.000000000 +0100 +++ new/bff-1.0.7/bff.c 2018-09-29 16:41:57.000000000 +0200 @@ -1,7 +1,7 @@ /* * Copyright (c) 2004 Alex Pankratov. All rights reserved. * - * Slightly-optimizing (tm) Brainfuck interpreter, 1.0.5 + * Moderately-optimizing (tm) Brainfuck interpreter, 1.0.7 * http://swapped.cc/bff */ @@ -100,14 +100,13 @@ n -= i; memmove(p, p+i, n); + p[n] = 0; /* preprocess */ - x = xalloc(NULL, n * sizeof(*x)); + x = xalloc(NULL, (n+1) * sizeof(*x)); for (i=0; i<n; i++) { - x[i].op = p[i]; - switch (p[i]) { case '[': @@ -120,10 +119,20 @@ break; if (l) die("no matching ]\n"); - + x[i].op = 'c'; x[i].p_ofx = chew(p, j+1, &x[i].v_ofx) - i; x[i].p_off = chew(p, i+1, &x[i].v_off) - i; + + /* [-] and [+] */ + if (j == i+2 && (p[i+1] == '-' || p[i+1] == '+')) + { + x[i].op = 'z'; + x[i].p_off = x[i].p_ofx; + x[i].v_off = x[i].v_ofx; + } + + i += x[i].p_off - 1; break; case ']': @@ -140,22 +149,35 @@ x[i].op = 'c'; x[i].p_off = chew(p, j+1, &x[i].v_off) - i; x[i].p_ofx = chew(p, i+1, &x[i].v_ofx) - i; + + i += x[i].p_ofx - 1; break; - case '<': - case '>': - /* ignore */ - break; - - default: - /* + - . , */ + case '+': + case '-': + case '.': + case ',': + x[i].op = p[i]; + for (j=i; j<n && p[j]==x[i].op; j++); x[i].op_arg = j-i; x[i].p_off = chew(p, j, &x[i].v_off) - i; + + i += x[i].p_off - 1; + break; + + case '<': + case '>': + /* chew() folds these into all other ops */ + default: + assert(0); break; } } + /* exit */ + x[i].op = 'x'; + /* allocate cell array - start with the moderate size */ jmax = 256; v = xalloc(NULL, jmax * sizeof(int)); @@ -198,15 +220,22 @@ break; case '.': for (k=0; k<z->op_arg; k++) +/* printf("%02x", v[j]); */ putchar(v[j]); + break; case ',': for (k=0; k<z->op_arg; k++) v[j] = input(fh); break; - default: - /* 0, ie eop */ + case 'z': + v[j] = 0; + break; + case 'x': goto _break; + + default: + assert(0); } z += z->p_off; @@ -216,7 +245,7 @@ } /* - * miscellania + * miscellanea */ int chew(char * p, int j, int * v_off) { @@ -281,7 +310,7 @@ void usage() { fprintf(stderr, - "bff: slightly-opimizing Brainfuck interpreter, 1.0.5, " + "bff: moderately-opimizing Brainfuck interpreter, 1.0.7, " "http://swapped.cc/bff\n" "Usage: bff [<program file> [<input data file]]\n"); @@ -298,4 +327,3 @@ exit(-1); } -