sannybuilder/dev

Invalid compiled param type of string arrays

MiranDMC opened this issue · 3 comments

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

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

x87 commented

fixed in beta.0