Jump to content
You are about to reply to a thread that has been inactive for 127 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

Second Life RC LeTigre 2024-07-22.10048683488

Took me a while to realize that I had the mono checkbox unticked. Ticking it fixed my problem, but whittling down my script to the bare minimum that produces this crash is just bizarre:

float get_value()
{   return -1;
}

default
{
    state_entry()
    {
        float v = get_value();
        llOwnerSay((string)((float)-1));
        llOwnerSay("no crash."); // execution reaches this point.
        llOwnerSay((string)v); // this causes a 'math error'.
        llOwnerSay("crash");
    }
}

somehow -1 returned from a function, is different than a -1 directly cast from an integer.

  • Like 1
  • Thanks 1
Posted

Interesting that the implicit cast of negative integers causes the error, but any non-negative integer is cast to a value of 0. And that the error occurs when the assigned variable is used, not at the assignment statement itself (so I guess the assignment itself is lazy).

  • Like 2
Posted (edited)

Implied is, that the string-cast is finding an unexpected value in "v"! 

That's consistent with "not causing an error until the value is used".

LSO is a MESS! Who knows how long ago that bug snuck in, or if it was always that picky when doing "implicit" type casting as in get_value()?

Edited by Love Zhaoying
Bad word choices am I yes
  • Like 1
Posted
12 minutes ago, Wulfie Reanimator said:

no-op statement

12 minutes ago, Wulfie Reanimator said:

v;

That bugged me awhile back when I found it, like ignoring return results from functions that return a type (without even the courtesy of a warning).

IT'S JUST WRONG!!1!!!1!

(And yes, I know that it is the same in some other languages too.  I just didn't know BEFORE that it was "ok".)

 

Posted
2 minutes ago, Love Zhaoying said:

That bugged me awhile back when I found it, like ignoring return results from functions that return a type (without even the courtesy of a warning).

IT'S JUST WRONG!!1!!!1!

(And yes, I know that it is the same in some other languages too.  I just didn't know BEFORE that it was "ok".)

I'm happy to also point out that ; is a valid statement!

But, more interestingly, list L = [v]; doesn't work either. That also causes a math error.

  • Thanks 2
Posted
7 minutes ago, Wulfie Reanimator said:

But, more interestingly, list L = [v]; doesn't work either. That also causes a math error.

In general, I don't trust "declare-assignments" unless they are assigning to constant values.  They are shushpishush.

  • Like 1
You are about to reply to a thread that has been inactive for 127 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...