1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Fix FunC UB (#656)

* Fix UB in func

* Improve optimizing int consts and unused variables in FunC

* Bump funC version to 0.4.3

* Fix analyzing repeat loop

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2023-04-03 10:13:39 +03:00 committed by GitHub
parent f51eb2d747
commit 8eb167b76a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 8 deletions

View file

@ -29,8 +29,12 @@ using namespace std::literals::string_literals;
int glob_func_cnt, undef_func_cnt, glob_var_cnt, const_cnt;
std::vector<SymDef*> glob_func, glob_vars;
std::set<std::string> prohibited_var_names;
SymDef* predefine_builtin_func(std::string name, TypeExpr* func_type) {
if (name.back() == '_') {
prohibited_var_names.insert(name);
}
sym_idx_t name_idx = sym::symbols.lookup(name, 1);
if (sym::symbols.is_keyword(name_idx)) {
std::cerr << "fatal: global function `" << name << "` already defined as a keyword" << std::endl;