mirror of https://github.com/arendst/Tasmota.git
Latest Berry fixes
This commit is contained in:
parent
05e72f6b9f
commit
2b97a03d4c
|
@ -650,6 +650,9 @@ buf_impl bytes_check_data(bvm *vm, size_t add_size) {
|
|||
buf_impl attr = m_read_attributes(vm, 1);
|
||||
/* check if the `size` is big enough */
|
||||
if (attr.len + (int32_t)add_size > attr.size) {
|
||||
if (attr.fixed) {
|
||||
be_raise(vm, BYTES_RESIZE_ERROR, BYTES_RESIZE_MESSAGE);
|
||||
}
|
||||
/* it does not fit so we need to realocate the buffer */
|
||||
bytes_resize(vm, &attr, attr.len + add_size);
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ void end_varinfo(bparser *parser, int beginpc)
|
|||
if (beginpc == -1) /* use block->beginpc by default */
|
||||
beginpc = binfo->beginpc;
|
||||
/* skip the variable of the previous blocks */
|
||||
for (; it->beginpc < beginpc; ++it);
|
||||
for (; (it <= end) && (it->beginpc < beginpc); ++it);
|
||||
for (; it <= end; ++it) {
|
||||
if (!it->endpc) /* write to endpc only once */
|
||||
it->endpc = finfo->pc;
|
||||
|
|
Loading…
Reference in New Issue