fixed expression calculation, fixed addArg

This commit is contained in:
ALEXks
2025-08-20 14:34:17 +03:00
parent 278fc1ff9c
commit 2cd02c295f
3 changed files with 9 additions and 6 deletions

View File

@@ -440,15 +440,18 @@ bool replaceConstantRec(SgExpression *&exp)
if (exp->variant() == CONST_REF)
{
SgExpression *ret = ReplaceParameter_(exp);
int sign = 1;
SgExpression* toCalc = ret;
if (ret->variant() == UNARY_ADD_OP)
toCalc = ret->lhs();
if (ret->variant() == MINUS_OP)
if (toCalc->variant() == UNARY_ADD_OP)
toCalc = toCalc->lhs();
if (toCalc->variant() == MINUS_OP)
{
toCalc = ret->lhs();
toCalc = toCalc->lhs();
sign = -1;
}
if (toCalc->isInteger())
{
exp = new SgValueExp(sign * toCalc->valueInteger());

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2440"
#define VERSION_SPF "2441"