fix: to_str() arg not freed

This commit is contained in:
overflowerror 2024-05-17 13:07:53 +02:00
parent b20faa745a
commit 2884890abc
4 changed files with 8 additions and 2 deletions

View file

@ -122,5 +122,9 @@ extern region_t* to_str(FILE* out, scope_t* scope, size_t argc, region_t** argv)
scope_remove(scope, ten);
scope_remove(scope, copy);
if (arg->is_temp) {
scope_remove(scope, arg);
}
return str;
}

View file

@ -0,0 +1 @@
print(to_str(1));

View file

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

View file

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