dev icon indicating copy to clipboard operation
dev copied to clipboard

Function call not negated if multiple return values used

Open MiranDMC opened this issue 10 months ago • 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.

MiranDMC avatar Apr 23 '24 09:04 MiranDMC

Problem occurs when returning single argument too.

MiranDMC avatar Apr 23 '24 09:04 MiranDMC

Fixed in 4.0.0

x87 avatar Aug 07 '24 03:08 x87