When using // pragma inline in a function, and that function is used in the condition of a do...while loop, the generated code is invalid, because the condition uses a variable which is defined within the braces of the loop, therefore it's out of scope.
For example:
// pragma inline
integer f(integer i)
{
if (i)
return 0;
return 2;
}
default
{
state_entry()
{
do
{
llSleep(1);
}
while (f(llGetLinkNumber()));
}
}
Generated code:
default {
state_entry() {
do {
integer _ret1;
integer i = llGetLinkNumber();
if (i) {
_ret1 = 0;
jump _end2;
}
_ret1 = 2;
@_end2;
}
while (_ret1); // Name not defined within scope (because it's out of scope)
}
}
When using
// pragma inline
in a function, and that function is used in the condition of ado...while
loop, the generated code is invalid, because the condition uses a variable which is defined within the braces of the loop, therefore it's out of scope.For example:
Generated code:
Thanks to Levio Serenity for the testing.