Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix advance_ext #746

Open
wants to merge 1 commit into
base: testnet
Choose a base branch
from
Open

Fix advance_ext #746

wants to merge 1 commit into from

Conversation

tvorogme
Copy link
Contributor

Such TLB:

_ a:(## 64) b:^# = A;
_ a:A = T;

Will generate:


bool skip(vm::CellSlice& cs) const override {
  return cs.advance_ext(0x10040);
}

Which has arguments: bits: bits_refs >> 16 and refs: bits_refs & 0xffff

bool CellSlice::advance_ext(unsigned bits_refs) {
  return advance_ext(bits_refs >> 16, bits_refs & 0xffff);
}

But it'll also generate:

bool T::unpack(vm::CellSlice& cs, T::Record& data) const {
  return cs.fetch_subslice_ext_to(0x10040, data.a);
}

Which has arguments: bits: size & 0xffff and refs: size >> 16

td::Ref<CellSlice> CellSlice::fetch_subslice_ext(unsigned size) {
  return fetch_subslice(size & 0xffff, size >> 16);
}

I've checked all current block.tlb scheme and as I understand bagged skip methods are not calling in cpp code. But block-auto.cpp contains invalid skip methods for 59 types. This can lead to random skip size of bits & refs for types.

@05373160476
Copy link

tvorogme:patch-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants