From 4121eab0417f678654db80ad20bdc7271059cc98 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Tue, 11 Jan 2022 17:29:08 +0100 Subject: [PATCH] Berry fix add for int+float --- lib/libesp32/berry/src/be_vm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libesp32/berry/src/be_vm.c b/lib/libesp32/berry/src/be_vm.c index 4936694ce..dd92d46e8 100644 --- a/lib/libesp32/berry/src/be_vm.c +++ b/lib/libesp32/berry/src/be_vm.c @@ -598,7 +598,9 @@ newframe: /* a new call frame */ } else if (var_isnumber(a) && var_isnumber(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; } // breal x = var2real(a), y = var2real(b); var_setreal(dst, x.r + y.r); } else if (var_isstr(a) && var_isstr(b)) { /* strcat */