Certain ll* function calls, placed after an unconditional return in a function result in a "UThread injection failed" message. Not all functions do. Other code after a return causes a run-time error. Possibly related to
SVC-1328. Examples (assume the same default state and state_entry event for each example):
// Compile error
test() {
integer x;
return;
llSetColor(ZERO_VECTOR, ALL_SIDES);
}
default {
state_entry() {
test();
}
}
// Run-time error
test() {
integer x;
return;
x+=1;
}
// Compiles and runs with no problem
test() {
integer x;
return;
x = llListFindList(["a"], ["a"]);
}
// Compiles and runs with no problem
test() {
integer x;
if (TRUE) return;
x+=1;
}
The run-time error is
[7:55] Donation Box: System.InvalidProgramException: Invalid IL code in LSL_0a331708_ce87_231f_2701_e40594700fa9:test (): IL_000d: nop
at LSL_0a331708_ce87_231f_2701_e40594700fa9.defaultstate_entry () [0x00000]
at LSL_0a331708_ce87_231f_2701_e40594700fa9defaultstate_entryFrame.ResumeVoid () [0x00000]
at LindenLab.SecondLife.UThread.UThread.Run () [0x00000]
at LindenLab.SecondLife.Script.Run (ScriptEvent evt) [0x00000]