wmww / BrainfuckIDE

A Brainfuck IDE/debugger designed to be intuitive, featureful and visually appealing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hangs when given non-halting programs

opened this issue · comments

The IDE will hang if told to "skip to end" with a non-halting program.

Example program:

+[>+]

Actions taken: Program input, run. IDE told to "skip to end."

Expected result: IDE stops after program runs too long or otherwise indicates that it cannot be "skipped to end."

Actual result: IDE runs program at high speed, using an entire CPU core. If user attempts to stop program using the "reset everything" button, IDE hangs.

Pull requests welcome, but I probably won't look into this at the moment. There's a lot of improvements I'd like to make, but I haven't been doing much brainfuck development or tooling lately.

It's on the line, but I guess it is a bug.

Hmm... looks like reset hangs even on long programs, like:

load 1000 into position 2
++++++++++
[
    >++++++++++
    [
        >++++++++++
    <-]
<-]

move to position 2
>>

move 1000 spaces to the right
[[>+<-]>-]

Ah, it's a memory issue, not a logic error (as can be seen by +[+] being resetable after clicking 'skip to end' and waiting, and +[>+] being resetable if you click reset within a few moments of 'skip to end' (before the tape gets too long). I tried a simple fix, but it just broke everything. You'll have to wait for #6.