When optimizing nonconst * const, cast the result to the type of the operator.

Per bug report by @Welcius.

Fixes #8.
This commit is contained in:
Sei Lisa 2019-07-02 15:40:20 +02:00
parent 750465f17b
commit 1bdaff32ab
5 changed files with 46 additions and 5 deletions

View file

@ -132,4 +132,7 @@
, llSin(-2147483648)
, llSin(2147483647)
, llSin(2147483647.0)
, 2147483647 * 1.0 * 2
, 3 * 1.0 / 2
, 3 / 2
]

View file

@ -128,4 +128,7 @@
, 0.9713102
, -0.9713102
, -0.9713102
, 4294967296.
, 1.5
, 1
]

View file

@ -0,0 +1,14 @@
default{timer(){
integer x = llGetNumberOfPrims();
integer y = llGetUnixTime();
llOwnerSay((string)(x * 1.0 / y));
llOwnerSay((string)(x / 1.0 / y));
llOwnerSay((string)(x / (-1.0) / y));
llOwnerSay((string)(x * 1.0 / y));
llOwnerSay((string)(x * (-1.0) / y));
llOwnerSay((string)(x * -2.0));
llOwnerSay((string)(x * 0.0 + y));
llOwnerSay((string)(x + 0.0 + y));
}}

View file

@ -0,0 +1,16 @@
default
{
timer()
{
integer x = llGetNumberOfPrims();
integer y = llGetUnixTime();
llOwnerSay((string)((float)x / y));
llOwnerSay((string)((float)x / y));
llOwnerSay((string)(-(float)x / y));
llOwnerSay((string)((float)x / y));
llOwnerSay((string)(-(float)x / y));
llOwnerSay((string)(-(x + (float)x)));
llOwnerSay((string)((float)y));
llOwnerSay((string)((float)x + y));
}
}