mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- fixed: ParseParameter should not make any assumptions about the necessity of a type cast between int and float.
With late resolving it cannot be guaranteed at this point and caused some incorrectly compiled code. Since the cast gets optimized away anyway when not needed there's no point being this selective with applying it.
This commit is contained in:
parent
a7254a4af5
commit
85a3cd984d
2 changed files with 40 additions and 46 deletions
|
@ -87,20 +87,14 @@ FxExpression *ParseParameter(FScanner &sc, PClassActor *cls, PType *type, bool c
|
|||
}
|
||||
// Do automatic coercion between ints and floats.
|
||||
if (type == TypeSInt32)
|
||||
{
|
||||
if (x->ValueType != VAL_Int)
|
||||
{
|
||||
x = new FxIntCast(x);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x->ValueType != VAL_Float)
|
||||
{
|
||||
x = new FxFloatCast(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == TypeName || type == TypeString)
|
||||
{
|
||||
sc.SetEscape(true);
|
||||
|
|
Loading…
Reference in a new issue