sannybuilder/dev

Function call not negated if multiple return values used

MiranDMC opened this issue · 1 comments

{$CLEO .cs}
nop
debug_on

int a, b
if
    not a, b = foo()
then
    trace "FAILED %d %d" a b
else
    trace "OK %d %d" a b
end

terminate_this_custom_script


function foo() : int, int
    //return 1 2 // condition result ok
    cleo_return_with true 1 2 // condition result ok
end

Function call in example compiles as 0AB1 instead of 8AB1, resulting in incorrect branch to be executed.

Problem occurs when returning single argument too.