aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/ast-tree.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-28 13:52:10 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-28 13:52:10 +0330
commit0d671d4364fa0db76fca6584a97c51de02b9e220 (patch)
tree9e94b3eadb57c381f5e8d218e32aa8f8e41f2081 /src/compiler/ast-tree.c
parent5823be69762ac3d15869d4de65647f0b9ca82449 (diff)
add more stuff to lib
fix use after free
Diffstat (limited to 'src/compiler/ast-tree.c')
-rw-r--r--src/compiler/ast-tree.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/ast-tree.c b/src/compiler/ast-tree.c
index 0b4bc63..fc9217e 100644
--- a/src/compiler/ast-tree.c
+++ b/src/compiler/ast-tree.c
@@ -5639,9 +5639,12 @@ bool setTypesFunctionCall(AstTree *tree, AstTreeSetTypesHelper _helper) {
AstTreeFunctionCallParam p0 = metadata->parameters[i];
AstTreeFunctionCallParam p1 = call->parameters[i];
- AstTree *v0 = getValue(p0.value, false);
- AstTree *v1 = getValue(p1.value, false);
- if (!isEqual(v0, v1)) {
+ AstTree *v0 = getValue(p0.value, true);
+ AstTree *v1 = getValue(p1.value, true);
+ bool res = isEqual(v0, v1);
+ astTreeDelete(v0);
+ astTreeDelete(v1);
+ if (!res) {
goto SEARCH_LOOP_CONTINUE;
}
}