Skip to content

Function call not negated if multiple return values used #322

Closed

Description

@MiranDMC
{$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.

Activity

  1. MiranDMC commented on Apr 23, 2024

    @MiranDMC
    Author

    Problem occurs when returning single argument too.

  2. added
    type:bug
    on Apr 23, 2024
  3. x87 commented on Aug 7, 2024

    @x87
    Collaborator

    Fixed in 4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:compilertype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions