fix: missing reset in clone

This commit is contained in:
overflowerror 2024-02-18 00:11:02 +01:00
parent bed6d3b2d7
commit 2a88a986ee
7 changed files with 25 additions and 3 deletions

View file

@ -53,6 +53,7 @@ void _copy(FILE* out, band_t* band, region_t* source, region_t* target) {
region_t* _clone(FILE* out, band_t* band, region_t* region) {
region_t* clone = band_allocate_tmp(band, region->size);
move_to(clone); reset();
copy(region, clone);
return clone;
}

View file

@ -2,6 +2,6 @@
>[-]++++++++++
>[-]++++++++++
>[-]++++++++++++++++++
>[-]++>>[-]<<<<<<[->>>>>+>+<<<<<<]>>>>>>[-<<<<<<+>>>>>>]<[-<+>]>[-]<<<<<[->>>>+>+<<<<<]>>>>>[-<<<<<+>>>>>]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]>[-]<<[->+>+<<]>>[-<<+>>]<<<<[-]>[->>[-<<<+>>>]>[-]<<[->+>+<<]>>[-<<+>>]<<<]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<[-<+>][-]++++++++++++++++++++[-<->]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<[-<->]
>[-]++>[-]>[-]<<<<<<[->>>>>+>+<<<<<<]>>>>>>[-<<<<<<+>>>>>>]<[-<+>][-]>[-]<<<<<[->>>>+>+<<<<<]>>>>>[-<<<<<+>>>>>][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<[->+>+<<]>>[-<<+>>]<<<<[-]>[->>[-<<<+>>>]>[-]<<[->+>+<<]>>[-<<+>>]<<<][-]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<[-<+>][-]++++++++++++++++++++[-<->][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<[-<->]
[-]>[-]>[-]>[-]>[-]++++++++++>[-]>[-]<<<<<<<[->>>>>>+<<+<+<[-]<[-]>>>>-[-<<<<+>+>>>]<<<[>>>>[-]<<<<[-]]<[->>>>+<<<<]>>>>>[>+<<<<[-]>>++++++++++>[-]]<<<<<<]>>>>[-<<<<+>>>>]>[-]++++++++++>>[-<[-]+<<<<+>>[-]>>>>[-]<<<-[-<+>>>>+<<<]>>>[<<[-]>>[-]]<<<<[->+<]>>[<++++++++++<<<<+>[-]>>>>[-]]>]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
<<[-]++++++++++.

View file

@ -0,0 +1,8 @@
var a = 1;
/* this print statement seems to somehow change the value of a */
print "a\n";
var b = (a - 1);
print to_str!(b);
print "\n";

View file

@ -0,0 +1,5 @@
[-]+
>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
<[-]+>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<[->-<]
>>[-]>[-]>[-]<<<<[-]>>>>>[-]++++++++++>[-]>[-]<<<<<<[->>>>>+<<<<<<+>>>>+<[-]<[-]>>>-[-<<<+>+>>]<<[>>>[-]<<<[-]]<[->>>+<<<]>>>>[>+<<<[-]>++++++++++>[-]]<<<<<]<[->+<]>>>>>[-]++++++++++>>[-<[-]+<<<+<<<[-]>>>>>>>>[-]<<<-[-<<<<<+>>>>>>>>+<<<]>>>[<<[-]>>[-]]<<<<<<<<[->>>>>+<<<<<]>>>>>>[<++++++++++<<<+>[-]>>>[-]]>]<<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
<<<<[-]++++++++++.

View file

@ -1,5 +1,5 @@
[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>[-]++++++++++++++++
>>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<<<[->>>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[<<<+>>>>[-]<<<<<[->>+>>>+<<<<<]>>>>>[-<<<<<+>>>>>]<[-]]<<<<<]
>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<<<[->>>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[<<<+>>>>[-]<<<<<[->>+>>>+<<<<<]>>>>>[-<<<<<+>>>>>]<[-]]<<<<<]
>>>[-]>[-]>[-]<<<<<[-]>[-]++++++++++>>>>>[-]>[-]<<<<<[->>>>+<<<<<<+>>>>>+<[-]<[-]<<-[->>+>+<<<]>>>[>>[-]<<[-]]<[-<<+>>]>>>[>+<<[-]<<<<++++++++++>>>>>[-]]<<<<]<<[->>+<<]>[-]++++++++++>>>>>>[-<[-]+<<+<<<<[-]>>>>>>>>[-]<<<<<<<-[-<+>>>>>>>>+<<<<<<<]>>>>>>>[<<[-]>>[-]]<<<<<<<<[->+<]>>>>>>[<<<<<++++++++++>>+>[-]>>[-]]>]<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
<<<<<[-]++++++++++.

View file

@ -1,5 +1,5 @@
[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<[->+>+<<]>>[-<<+>>]<<<[->>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[>[-]<<<<[->+>>>+<<<<]>>>>[-<<<<+>>>>]<[-]]<<<<]>>[[-<->]<[-<+>]>]
>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<[->+>+<<]>>[-<<+>>]<<<[->>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[>[-]<<<<[->+>>>+<<<<]>>>>[-<<<<+>>>>]<[-]]<<<<]>>[[-<->]<[-<+>]>]
<[-]>[-]>[-]>[-]>[-]++++++++++>[-]>[-]<<<<<<<[->>>>>>+<<+<+<[-]<[-]>>>>-[-<<<<+>+>>>]<<<[>>>>[-]<<<<[-]]<[->>>>+<<<<]>>>>>[>+<<<<[-]>>++++++++++>[-]]<<<<<<]>>>>[-<<<<+>>>>]>[-]++++++++++>>[-<[-]+<<<<+>>[-]>>>>[-]<<<-[-<+>>>>+<<<]>>>[<<[-]>>[-]]<<<<[->+<]>>[<++++++++++<<<<+>[-]>>>>[-]]>]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
<<[-]++++++++++.

View file

@ -0,0 +1,8 @@
[-]+
>[-]>[-]<<[->+>+<<]>>[-<<+>>]<[>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
<[-]+>[-]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<[-<+>]<[>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
<<[-]]
[-]+>[-]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<[->-<]
[-]>>[-]<[-<+>>+<]>[-<+>]<<[>>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
<<<[-]]
<[-]]