mirror of https://github.com/arendst/Tasmota.git
Merge branch 'arendst:development' into patch-3
This commit is contained in:
commit
9fd1af32ca
|
@ -317,7 +317,7 @@ static void free_suffix(bfuncinfo *finfo, bexpdesc *e)
|
|||
be_code_freeregs(finfo, 1);
|
||||
}
|
||||
/* release object register */
|
||||
if (e->v.ss.tt == ETREG && (int)e->v.ss.obj >= nlocal) {
|
||||
if (e->v.ss.tt == ETREG && (int)e->v.ss.obj >= nlocal && (e->v.ss.obj + 1 >= finfo->freereg)) {
|
||||
be_code_freeregs(finfo, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,3 +9,20 @@ var pairs = {
|
|||
for i : 0 .. keys.size() - 1
|
||||
assert(pairs[keys[i]] == 'value' .. i + 1)
|
||||
end
|
||||
|
||||
#- test cases related to #101 -#
|
||||
class C var l end
|
||||
c=C()
|
||||
c.l=[0,1,2]
|
||||
|
||||
def t_101_nok_1() return c.l[0..1] end
|
||||
def t_101_ok_1() var l2 = c.l return l2[0..1] end
|
||||
|
||||
t_i = 0
|
||||
def t_101_nok_2() return c.l[t_i] end
|
||||
def t_101_ok_2() return c.l[0] end
|
||||
|
||||
assert(t_101_nok_1() == [0, 1])
|
||||
assert(t_101_ok_1() == [0, 1])
|
||||
assert(t_101_nok_2() == 0)
|
||||
assert(t_101_ok_2() == 0)
|
||||
|
|
|
@ -888,7 +888,11 @@ void HAssAnnounceSensors(void)
|
|||
TasmotaGlobal.tele_period = tele_period_save;
|
||||
size_t sensordata_len = ResponseLength();
|
||||
char sensordata[sensordata_len+2]; // dynamically adjust the size
|
||||
#ifdef MQTT_DATA_STRING
|
||||
strcpy(sensordata, TasmotaGlobal.mqtt_data.c_str()); // we can use strcpy since the buffer has the right size
|
||||
#else
|
||||
strcpy(sensordata, TasmotaGlobal.mqtt_data); // we can use strcpy since the buffer has the right size
|
||||
#endif
|
||||
|
||||
// ******************* JSON TEST *******************
|
||||
// char sensordata[512];
|
||||
|
|
Loading…
Reference in New Issue