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

bugfix in config sc + docs

This commit is contained in:
ton 2020-04-01 13:07:29 +04:00
parent 4b5dd4525e
commit 9bff9285b8
4 changed files with 308 additions and 6 deletions

View file

@ -2258,9 +2258,11 @@ std::vector<Ref<vm::Cell>> get_vm_libraries() {
// +32 = return c5 (actions)
// +64 = log vm ops to stderr
// +128 = pop hard gas limit (enabled by ACCEPT) from stack as well
// +256 = enable stack trace
// +512 = enable debug instructions
void interpret_run_vm(IntCtx& ctx, int mode) {
if (mode < 0) {
mode = ctx.stack.pop_smallint_range(0xff);
mode = ctx.stack.pop_smallint_range(0x3ff);
}
bool with_data = mode & 4;
Ref<vm::Tuple> c7;
@ -2282,8 +2284,8 @@ void interpret_run_vm(IntCtx& ctx, int mode) {
OstreamLogger ostream_logger(ctx.error_stream);
auto log = create_vm_log((mode & 64) && ctx.error_stream ? &ostream_logger : nullptr);
vm::GasLimits gas{gas_limit, gas_max};
int res =
vm::run_vm_code(cs, ctx.stack, mode & 3, &data, log, nullptr, &gas, get_vm_libraries(), std::move(c7), &actions);
int res = vm::run_vm_code(cs, ctx.stack, (mode & 3) | ((mode & 0x300) >> 6), &data, log, nullptr, &gas,
get_vm_libraries(), std::move(c7), &actions);
ctx.stack.push_smallint(res);
if (with_data) {
ctx.stack.push_cell(std::move(data));

View file

@ -496,7 +496,7 @@ int register_voting_proposal(slice cs, int msg_value) impure inline_ref {
}
if (tag == 0x6e565052) {
;; new voting proposal
var price = register_voting_proposal(cs, msg_value);
var price = register_voting_proposal(in_msg, msg_value);
int mode = 64;
int ans_tag = - price;
if (price >= 0) {

View file

@ -44,7 +44,8 @@ VmState::VmState(Ref<CellSlice> _code, Ref<Stack> _stack, int flags, Ref<Cell> _
, quit0(true, 0)
, quit1(true, 1)
, log(log)
, libraries(std::move(_libraries)) {
, libraries(std::move(_libraries))
, stack_trace((flags >> 2) & 1) {
ensure_throw(init_cp(0));
set_c4(std::move(_data));
if (init_c7.not_null()) {
@ -63,7 +64,8 @@ VmState::VmState(Ref<CellSlice> _code, Ref<Stack> _stack, const GasLimits& gas,
, quit1(true, 1)
, log(log)
, gas(gas)
, libraries(std::move(_libraries)) {
, libraries(std::move(_libraries))
, stack_trace((flags >> 2) & 1) {
ensure_throw(init_cp(0));
set_c4(std::move(_data));
if (init_c7.not_null()) {