Merge pull request #14382 from s-hadinger/berry_add_fix

Berry fix add for int+float
This commit is contained in:
s-hadinger 2022-01-11 17:58:42 +01:00 committed by GitHub
commit debbfd24ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -598,7 +598,9 @@ newframe: /* a new call frame */
} else if (var_isnumber(a) && var_isnumber(b)) { } else if (var_isnumber(a) && var_isnumber(b)) {
union bvaldata x, y; // TASMOTA workaround for ESP32 rev0 bug union bvaldata x, y; // TASMOTA workaround for ESP32 rev0 bug
x.i = a->v.i; x.i = a->v.i;
if (var_isint(a)) { x.r = (breal) x.i; }
y.i = b->v.i; y.i = b->v.i;
if (var_isint(b)) { y.r = (breal) y.i; }
// breal x = var2real(a), y = var2real(b); // breal x = var2real(a), y = var2real(b);
var_setreal(dst, x.r + y.r); var_setreal(dst, x.r + y.r);
} else if (var_isstr(a) && var_isstr(b)) { /* strcat */ } else if (var_isstr(a) && var_isstr(b)) { /* strcat */