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

vm: bugfixes

This commit is contained in:
ton 2020-03-02 17:52:55 +04:00
parent 27aaa11524
commit ba76f1404e
30 changed files with 396 additions and 178 deletions

View file

@ -67,9 +67,14 @@ Ref<DataCell> CellBuilder::finalize_copy(bool special) const {
return cell;
}
Ref<DataCell> CellBuilder::finalize_novm(bool special) {
td::Result<Ref<DataCell>> CellBuilder::finalize_novm_nothrow(bool special) {
auto res = DataCell::create(data, size(), td::mutable_span(refs.data(), size_refs()), special);
bits = refs_cnt = 0;
return res;
}
Ref<DataCell> CellBuilder::finalize_novm(bool special) {
auto res = finalize_novm_nothrow(special);
if (res.is_error()) {
LOG(DEBUG) << res.error();
throw CellWriteError{};
@ -570,11 +575,11 @@ CellBuilder* CellBuilder::make_copy() const {
return c;
}
CellSlice CellBuilder::as_cellslice() const & {
CellSlice CellBuilder::as_cellslice() const& {
return CellSlice{finalize_copy()};
}
Ref<CellSlice> CellBuilder::as_cellslice_ref() const & {
Ref<CellSlice> CellBuilder::as_cellslice_ref() const& {
return Ref<CellSlice>{true, finalize_copy()};
}

View file

@ -177,12 +177,13 @@ class CellBuilder : public td::CntObject {
Ref<DataCell> finalize_copy(bool special = false) const;
Ref<DataCell> finalize(bool special = false);
Ref<DataCell> finalize_novm(bool special = false);
td::Result<Ref<DataCell>> finalize_novm_nothrow(bool special = false);
bool finalize_to(Ref<Cell>& res, bool special = false) {
return (res = finalize(special)).not_null();
}
CellSlice as_cellslice() const &;
CellSlice as_cellslice() const&;
CellSlice as_cellslice() &&;
Ref<CellSlice> as_cellslice_ref() const &;
Ref<CellSlice> as_cellslice_ref() const&;
Ref<CellSlice> as_cellslice_ref() &&;
static td::int64 get_total_cell_builders() {
return get_thread_safe_counter().sum();