Skip to content

Invalid compiled param type of string arrays #290

Closed

Description

@MiranDMC

Sanny produces invalid code when trying to pass element of short strings array to opcode.

{$CLEO .cs}
{$USE debug}

0000:

const
    msg_count = 10
end
var
    $MESSAGE_LABELS : array msg_count of ShortString
end

0@ = 0

// problem 1
0AD3: $MESSAGE_LABELS[0@] = string_format "put %s" 'LABEL' // ok

//0AD3: $MESSAGE_LABELS[3] = string_format "put %s" 'LABEL' // error! output param compiled as DT_VAR type
//0AD3: s$MESSAGE_LABELS[3] = string_format "put %s" 'LABEL' // walkaround

// problem 2
cleo_call @FUNC args 1 $MESSAGE_LABELS[0@] // error! output param compiled as DT_LVAR type

0A93: terminate_this_custom_script


// arg 0 - text
:FUNC
    trace "FUNC arg %s" 0@
cleo_return

Activity

  1. x87 commented on Nov 17, 2023

    @x87
    Collaborator
     // problem 2
    cleo_call @FUNC args 1 $MESSAGE_LABELS[0@] // error! output param compiled as DT_LVAR type
    

    @MiranDMC can you clarify more on what the problem is? The output in a compiled file has correct data type 0xC (global string array).

  2. MiranDMC commented on Nov 17, 2023

    @MiranDMC
    Author

    Hmm right. Seems CLEO's opcode 0AB1 handling is missing support for that type.

  3. x87 commented on Nov 20, 2023

    @x87
    Collaborator

    fixed in beta.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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions