Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid compiled param type of string arrays #290

Closed
MiranDMC opened this issue Nov 15, 2023 · 3 comments
Closed

Invalid compiled param type of string arrays #290

MiranDMC opened this issue Nov 15, 2023 · 3 comments

Comments

@MiranDMC
Copy link

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
@x87
Copy link
Collaborator

x87 commented Nov 17, 2023

 // 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).

@MiranDMC
Copy link
Author

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

@x87 x87 mentioned this issue Nov 18, 2023
59 tasks
@x87
Copy link
Collaborator

x87 commented Nov 20, 2023

fixed in beta.0

@x87 x87 closed this as completed Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants