mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- fixed: FxPreIncrDecr depended on undefined compiler behavior.
It could only work with right to left function argument processing, but with left to right it failed because the ParseExpressionA call altered sc.TokenType. Note that with register-based arguments on 64 bit platforms this is a very critical issue!
This commit is contained in:
parent
954ac8ce5e
commit
3ce25bc348
1 changed files with 3 additions and 2 deletions
|
@ -309,7 +309,8 @@ static FxExpression *ParseExpressionC (FScanner &sc, PClassActor *cls)
|
||||||
static FxExpression *ParseExpressionB (FScanner &sc, PClassActor *cls)
|
static FxExpression *ParseExpressionB (FScanner &sc, PClassActor *cls)
|
||||||
{
|
{
|
||||||
sc.GetToken();
|
sc.GetToken();
|
||||||
switch(sc.TokenType)
|
int token = sc.TokenType;
|
||||||
|
switch(token)
|
||||||
{
|
{
|
||||||
case '~':
|
case '~':
|
||||||
return new FxUnaryNotBitwise(ParseExpressionA (sc, cls));
|
return new FxUnaryNotBitwise(ParseExpressionA (sc, cls));
|
||||||
|
@ -325,7 +326,7 @@ static FxExpression *ParseExpressionB (FScanner &sc, PClassActor *cls)
|
||||||
|
|
||||||
case TK_Incr:
|
case TK_Incr:
|
||||||
case TK_Decr:
|
case TK_Decr:
|
||||||
return new FxPreIncrDecr(ParseExpressionA(sc, cls), sc.TokenType);
|
return new FxPreIncrDecr(ParseExpressionA(sc, cls), token);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sc.UnGet();
|
sc.UnGet();
|
||||||
|
|
Loading…
Reference in a new issue