mirror of
https://github.com/sigmasternchen/macrofuck
synced 2025-03-15 15:18:56 +00:00
fix: missing reset in clone
This commit is contained in:
parent
bed6d3b2d7
commit
2a88a986ee
7 changed files with 25 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
>[-]++++++++++
|
||||
>[-]++++++++++
|
||||
>[-]++++++++++++++++++
|
||||
>[-]++>>[-]<<<<<<[->>>>>+>+<<<<<<]>>>>>>[-<<<<<<+>>>>>>]<[-<+>]>[-]<<<<<[->>>>+>+<<<<<]>>>>>[-<<<<<+>>>>>]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]>[-]<<[->+>+<<]>>[-<<+>>]<<<<[-]>[->>[-<<<+>>>]>[-]<<[->+>+<<]>>[-<<+>>]<<<]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<[-<+>][-]++++++++++++++++++++[-<->]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<[-<->]
|
||||
>[-]++>[-]>[-]<<<<<<[->>>>>+>+<<<<<<]>>>>>>[-<<<<<<+>>>>>>]<[-<+>][-]>[-]<<<<<[->>>>+>+<<<<<]>>>>>[-<<<<<+>>>>>][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<[->+>+<<]>>[-<<+>>]<<<<[-]>[->>[-<<<+>>>]>[-]<<[->+>+<<]>>[-<<+>>]<<<][-]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<[-<+>][-]++++++++++++++++++++[-<->][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<[-<->]
|
||||
[-]>[-]>[-]>[-]>[-]++++++++++>[-]>[-]<<<<<<<[->>>>>>+<<+<+<[-]<[-]>>>>-[-<<<<+>+>>>]<<<[>>>>[-]<<<<[-]]<[->>>>+<<<<]>>>>>[>+<<<<[-]>>++++++++++>[-]]<<<<<<]>>>>[-<<<<+>>>>]>[-]++++++++++>>[-<[-]+<<<<+>>[-]>>>>[-]<<<-[-<+>>>>+<<<]>>>[<<[-]>>[-]]<<<<[->+<]>>[<++++++++++<<<<+>[-]>>>>[-]]>]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
|
||||
<<[-]++++++++++.
|
||||
|
|
8
test/cases/008a-bug-calc-sub-zero.in
Normal file
8
test/cases/008a-bug-calc-sub-zero.in
Normal 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";
|
5
test/cases/008a-bug-calc-sub-zero.out
Normal file
5
test/cases/008a-bug-calc-sub-zero.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
[-]+
|
||||
>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
|
||||
<[-]+>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<[->-<]
|
||||
>>[-]>[-]>[-]<<<<[-]>>>>>[-]++++++++++>[-]>[-]<<<<<<[->>>>>+<<<<<<+>>>>+<[-]<[-]>>>-[-<<<+>+>>]<<[>>>[-]<<<[-]]<[->>>+<<<]>>>>[>+<<<[-]>++++++++++>[-]]<<<<<]<[->+<]>>>>>[-]++++++++++>>[-<[-]+<<<+<<<[-]>>>>>>>>[-]<<<-[-<<<<<+>>>>>>>>+<<<]>>>[<<[-]>>[-]]<<<<<<<<[->>>>>+<<<<<]>>>>>>[<++++++++++<<<+>[-]>>>[-]]>]<<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
|
||||
<<<<[-]++++++++++.
|
|
@ -1,5 +1,5 @@
|
|||
[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
>[-]++++++++++++++++
|
||||
>>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<<<[->>>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[<<<+>>>>[-]<<<<<[->>+>>>+<<<<<]>>>>>[-<<<<<+>>>>>]<[-]]<<<<<]
|
||||
>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<<<<[->>>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[<<<+>>>>[-]<<<<<[->>+>>>+<<<<<]>>>>>[-<<<<<+>>>>>]<[-]]<<<<<]
|
||||
>>>[-]>[-]>[-]<<<<<[-]>[-]++++++++++>>>>>[-]>[-]<<<<<[->>>>+<<<<<<+>>>>>+<[-]<[-]<<-[->>+>+<<<]>>>[>>[-]<<[-]]<[-<<+>>]>>>[>+<<[-]<<<<++++++++++>>>>>[-]]<<<<]<<[->>+<<]>[-]++++++++++>>>>>>[-<[-]+<<+<<<<[-]>>>>>>>>[-]<<<<<<<-[-<+>>>>>>>>+<<<<<<<]>>>>>>>[<<[-]>>[-]]<<<<<<<<[->+<]>>>>>>[<<<<<++++++++++>>+>[-]>>[-]]>]<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
|
||||
<<<<<[-]++++++++++.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
>>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<[->+>+<<]>>[-<<+>>]<<<[->>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[>[-]<<<<[->+>>>+<<<<]>>>>[-<<<<+>>>>]<[-]]<<<<]>>[[-<->]<[-<+>]>]
|
||||
>[-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<<[->>+>+<<<]>>>[-<<<+>>>][-]>[-]<<[->+>+<<]>>[-<<+>>]<<<[->>->>[-]+<[-]>>[-]<<<[->+>>+<<<]>>>[-<<<+>>>]<<[>[-]<[-]]>[>[-]<<<<[->+>>>+<<<<]>>>>[-<<<<+>>>>]<[-]]<<<<]>>[[-<->]<[-<+>]>]
|
||||
<[-]>[-]>[-]>[-]>[-]++++++++++>[-]>[-]<<<<<<<[->>>>>>+<<+<+<[-]<[-]>>>>-[-<<<<+>+>>>]<<<[>>>>[-]<<<<[-]]<[->>>>+<<<<]>>>>>[>+<<<<[-]>>++++++++++>[-]]<<<<<<]>>>>[-<<<<+>>>>]>[-]++++++++++>>[-<[-]+<<<<+>>[-]>>>>[-]<<<-[-<+>>>>+<<<]>>>[<<[-]>>[-]]<<<<[->+<]>>[<++++++++++<<<<+>[-]>>>>[-]]>]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++<<.>.>.
|
||||
<<[-]++++++++++.
|
||||
|
|
8
test/cases/012-if-else-with-var.out
Normal file
8
test/cases/012-if-else-with-var.out
Normal file
|
@ -0,0 +1,8 @@
|
|||
[-]+
|
||||
>[-]>[-]<<[->+>+<<]>>[-<<+>>]<[>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
|
||||
<[-]+>[-]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<[-<+>]<[>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
|
||||
<<[-]]
|
||||
[-]+>[-]>[-]<<<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<[->-<]
|
||||
[-]>>[-]<[-<+>>+<]>[-<+>]<<[>>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<.>.
|
||||
<<<[-]]
|
||||
<[-]]
|
Loading…
Reference in a new issue