From 768a280f09abce86cfb853fe5a72140b0a4cade3 Mon Sep 17 00:00:00 2001 From: ALEXks Date: Wed, 15 Nov 2023 11:13:26 +0300 Subject: [PATCH] update fdvm, fixed routine' --- dvm/fdvm/trunk/Sage/lib/include/bif_node.def | 1 + dvm/fdvm/trunk/Sage/lib/include/unparseDVM.def | 2 +- dvm/fdvm/trunk/Sage/lib/newsrc/unparse.c | 4 +++- .../Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp | 5 ++++- sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp | 2 +- sapfor/experts/Sapfor_2017/_src/Utils/version.h | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dvm/fdvm/trunk/Sage/lib/include/bif_node.def b/dvm/fdvm/trunk/Sage/lib/include/bif_node.def index 504250d..5b3293a 100644 --- a/dvm/fdvm/trunk/Sage/lib/include/bif_node.def +++ b/dvm/fdvm/trunk/Sage/lib/include/bif_node.def @@ -438,6 +438,7 @@ DEFNODECODE(ACC_TARGETS_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_') DEFNODECODE(ACC_ASYNC_OP, "nodetext",'e',0,LLNODE, '_','_','_','_','_') DEFNODECODE(SHADOW_NAMES_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_') DEFNODECODE(ACC_TIE_OP, "nodetext",'e',1,LLNODE, '_','_','_','_','_') +DEFNODECODE(DUMMY_REF, "nodetext",'r',0,LLNODE, '_','_','s','_','_') DEFNODECODE(ACC_CALL_STMT,"nodetext",'s',2,BIFNODE, '_','_','_','_','_') DEFNODECODE(DVM_NEW_VALUE_DIR,"nodetext",'s',1,BIFNODE, '_','_','_','_','_') diff --git a/dvm/fdvm/trunk/Sage/lib/include/unparseDVM.def b/dvm/fdvm/trunk/Sage/lib/include/unparseDVM.def index a26cdab..3e54b9c 100644 --- a/dvm/fdvm/trunk/Sage/lib/include/unparseDVM.def +++ b/dvm/fdvm/trunk/Sage/lib/include/unparseDVM.def @@ -253,7 +253,7 @@ DEFNODECODE(DVM_NEW_VALUE_DIR, "%CMNT!DVM$%PUTTABCOMTNEW_VALUE%NL", DEFNODECODE(DVM_IO_MODE_DIR, "%CMNT!DVM$%PUTTABCOMTIO_MODE (%LL1)%NL", 's',1,BIFNODE) -DEFNODECODE(DVM_SHADOW_ADD_DIR, "%CMNT!DVM$%PUTTABCOMTSHADOW_ADD (%LL1 = %LL2)%IF(%LL3!=%NULLL) INCLUDE_TO %LL3%ENDIF%NL", +DEFNODECODE(DVM_SHADOW_ADD_DIR, "%CMNT!DVM$%PUTTABCOMTSHADOW_ADD (%LL1 = %LL2)%IF(%LL3!=%NULL) INCLUDE_TO %LL3%ENDIF%NL", 's',3,BIFNODE) DEFNODECODE(DVM_LOCALIZE_DIR, "%CMNT!DVM$%PUTTABCOMTLOCALIZE (%LL1 => %LL2)%NL", 's',2,BIFNODE) diff --git a/dvm/fdvm/trunk/Sage/lib/newsrc/unparse.c b/dvm/fdvm/trunk/Sage/lib/newsrc/unparse.c index b724737..66426c9 100644 --- a/dvm/fdvm/trunk/Sage/lib/newsrc/unparse.c +++ b/dvm/fdvm/trunk/Sage/lib/newsrc/unparse.c @@ -795,7 +795,9 @@ static void realocBuf(int minSize) newSize = minSize + 1; Buf_address = UnpBuf = realloc(UnpBuf, newSize); - //printf(" realloc buffer from %lld to %lld\n", max_lenght_buf, newSize); + memset(UnpBuf + max_lenght_buf, 0, newSize - max_lenght_buf); + + //printf(" realloc buffer from %ld to %ld\n", max_lenght_buf, newSize); max_lenght_buf = newSize; } diff --git a/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp b/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp index 42c6d60..1acb3c5 100644 --- a/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp +++ b/sapfor/experts/Sapfor_2017/_src/DvmhRegions/DvmhRegionInserter.cpp @@ -882,6 +882,8 @@ static bool filterFromList(SgStatement* st, const set& idents, bool excl bool empty = false; SgExpression* list = st->expr(0); vector newList; + + int total = 0; while (list) { if (exclude) @@ -894,12 +896,13 @@ static bool filterFromList(SgStatement* st, const set& idents, bool excl if (idents.find(list->lhs()->symbol()->identifier()) != idents.end()) newList.push_back(list->lhs()); } + total++; list = list->rhs(); } if (newList.size() == 0) empty = true; - else + else if (total != newList.size()) st->setExpression(0, makeExprList(newList)); return empty; diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp index b6559c4..037d697 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp @@ -2611,7 +2611,7 @@ SgExpression* makeExprList(const vector& items, bool withSort) int tmpVal = 0; for (auto& elem : items) { - if (elem->variant() == VAR_REF || elem->variant() == ARRAY_REF) + if (elem->variant() == VAR_REF || elem->variant() == ARRAY_REF || elem->variant() == CONST_REF) sorted.insert(make_pair(elem->unparse(), elem)); else if (elem->lhs() && elem->lhs()->variant() == VAR_REF || elem->lhs()->variant() == ARRAY_REF) sorted.insert(make_pair(elem->lhs()->unparse(), elem)); diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/version.h b/sapfor/experts/Sapfor_2017/_src/Utils/version.h index 7002f57..7f74a25 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/version.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/version.h @@ -1,3 +1,3 @@ #pragma once -#define VERSION_SPF "2236" +#define VERSION_SPF "2237"