diff options
Diffstat (limited to 'src/runner')
-rw-r--r-- | src/runner/runner.c | 7 | ||||
-rw-r--r-- | src/runner/runner.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/runner/runner.c b/src/runner/runner.c index c6a8bf0..984af3f 100644 --- a/src/runner/runner.c +++ b/src/runner/runner.c @@ -30,6 +30,11 @@ void runnerVariableSetValue(AstTreeVariable *variable, AstTree *value) { if (variable->isConst) { UNREACHABLE; } + runnerVariableSetValueWihtoutConstCheck(variable, value); +} + +void runnerVariableSetValueWihtoutConstCheck(AstTreeVariable *variable, + AstTree *value) { if (variable->value != NULL) { astTreeDelete(variable->value); } @@ -71,7 +76,7 @@ AstTree *runAstTreeFunction(AstTree *tree, AstTreeFunctionCallParam *arguments, AstTreeFunctionCallParam param = arguments[i]; AstTreeVariable *arg = function->arguments.data[i]; AstTree *value = runExpression(param.value, &shouldRet, false); - runnerVariableSetValue(arg, value); + runnerVariableSetValueWihtoutConstCheck(arg, value); } shouldRet = false; diff --git a/src/runner/runner.h b/src/runner/runner.h index 10fd8dc..2ff2ec2 100644 --- a/src/runner/runner.h +++ b/src/runner/runner.h @@ -4,6 +4,7 @@ #include <stdint.h> void runnerVariableSetValue(AstTreeVariable *variable,AstTree *value); +void runnerVariableSetValueWihtoutConstCheck(AstTreeVariable *variable,AstTree *value); bool runAstTree(AstTreeRoot *root); |