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

Add namespaces to Fift (#641)

* Add fift-based disassembler

* Fift improvements: namespaces, hashmaps, flow controls

* Fift: add lib with better block structuring and more

* Minor changes in fift HashMap + tests (#643)

* Minor changes in fift HashMap

* Add tests for extended fift

---------

Co-authored-by: OmicronTau <omicron@ton.org>
Co-authored-by: Tolya <1449561+tolya-yanot@users.noreply.github.com>
Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2023-03-10 14:16:29 +03:00 committed by GitHub
parent 4590ed381b
commit 865ebfce8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 2323 additions and 699 deletions

View file

@ -378,8 +378,8 @@ int exec_if_bit_jmp(VmState* st, unsigned args) {
}
std::string dump_if_bit_jmp(CellSlice& cs, unsigned args) {
std::ostringstream os{args & 0x20 ? "IFN" : " IF"};
os << "BITJMP " << (args & 0x1f);
std::ostringstream os;
os << "IF" << (args & 0x20 ? "N" : "") << "BITJMP " << (args & 0x1f);
return os.str();
}
@ -408,8 +408,8 @@ std::string dump_if_bit_jmpref(CellSlice& cs, unsigned args, int pfx_bits) {
}
cs.advance(pfx_bits);
cs.advance_refs(1);
std::ostringstream os{args & 0x20 ? "IFN" : " IF"};
os << "BITJMPREF " << (args & 0x1f);
std::ostringstream os;
os << "IF" << (args & 0x20 ? "N" : "") << "BITJMPREF " << (args & 0x1f);
return os.str();
}
@ -597,8 +597,8 @@ int exec_setcontargs(VmState* st, unsigned args) {
std::string dump_setcontargs(CellSlice& cs, unsigned args, const char* name) {
int copy = (args >> 4) & 15, more = ((args + 1) & 15) - 1;
std::ostringstream os{name};
os << ' ' << copy << ',' << more;
std::ostringstream os;
os << name << ' ' << copy << ',' << more;
return os.str();
}
@ -1065,8 +1065,8 @@ std::string dump_throw_any(CellSlice& cs, unsigned args) {
bool has_param = args & 1;
bool has_cond = args & 6;
bool throw_cond = args & 2;
std::ostringstream os{has_param ? "THROWARG" : "THROW"};
os << "ANY";
std::ostringstream os;
os << "THROW" << (has_param ? "ARG" : "") << "ANY";
if (has_cond) {
os << (throw_cond ? "IF" : "IFNOT");
}