Merge pull request #15893 from s-hadinger/berry_fix_crash_lt

Berry fix crash on ESP32 early revisions
This commit is contained in:
s-hadinger 2022-06-29 10:28:15 +02:00 committed by GitHub
commit 5e1eead987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -114,7 +114,13 @@
if (var_isint(a) && var_isint(b)) { \
res = ibinop(op, a, b); \
} else if (var_isnumber(a) && var_isnumber(b)) { \
res = var2real(a) op var2real(b); \
/* res = var2real(a) op var2real(b); */ \
union bvaldata x, y; /* TASMOTA workaround for ESP32 rev0 bug */ \
x.i = a->v.i;\
if (var_isint(a)) { x.r = (breal) x.i; }\
y.i = b->v.i;\
if (var_isint(b)) { y.r = (breal) y.i; }\
res = x.r op y.r; \
} else if (var_isstr(a) && var_isstr(b)) { \
bstring *s1 = var_tostr(a), *s2 = var_tostr(b); \
res = be_strcmp(s1, s2) op 0; \