bfc icon indicating copy to clipboard operation
bfc copied to clipboard

Mangled output of ANSI escape sequences in v1.11.0 and master branch

Open eliminmax opened this issue 2 years ago • 4 comments

I am sorry that I can't think of a better way to put this, but bfc installed with cargo install --git (tested with both the master branch and tag 1.11.0) mangles the output of a program I wrote.

My program's output should be a mix of ANSI escape sequences and whitespace that look like the following: image

Instead, I get this:

image

Testing the same code with a different compiler (specifically ebfc from ELFkickers 3.2) and 2 interpreters (beef and one rather slow one I created myself and have not yet released publicly) have the expected output. Additionally, older versions of bfc work as expected. I installed version 1.10.0 with the command cargo install --git https://github.com/Wilfred/bfc.git --tag 1.10.0 and that worked properly.

In case it is helpful, the code for my colortest.bf program is here.

I have an asciinema recording comparing the output of bfc with the other compiler and interpreters which can be viewed here

eliminmax avatar Jun 30 '23 02:06 eliminmax

Using git bisect, I was able to determine that the issue was introduced in commit 8709150, which is the one tagged 1.11.0. The commit before that one, c60c995, works properly.

eliminmax avatar Jun 30 '23 02:06 eliminmax

Thanks for the great report and repros. :)

I've released 1.12 that reverts this bad optimisation, and I'll work out what's wrong with the optimisation and add a fixed version at some point in the future.

Wilfred avatar Sep 17 '23 23:09 Wilfred

Just gave version 1.12.0 a try, and it is working perfectly. Thanks!

eliminmax avatar Sep 19 '23 20:09 eliminmax

Glad to hear it! I'm going to leave this open so I can fix the optimisation with the repro given.

Wilfred avatar Sep 20 '23 02:09 Wilfred