Fix coverity issue: memory corruption due to overlapping copy.

This commit is contained in:
Tor Andersson
2019-09-06 12:14:22 +02:00
parent 16049bbbdc
commit 69b312d13b

View File

@@ -592,12 +592,12 @@ retry:
if (x->type == JS_TBOOLEAN) {
x->type = JS_TNUMBER;
x->u.number = x->u.boolean;
x->u.number = x->u.boolean ? 1 : 0;
goto retry;
}
if (y->type == JS_TBOOLEAN) {
y->type = JS_TNUMBER;
y->u.number = y->u.boolean;
y->u.number = y->u.boolean ? 1 : 0;
goto retry;
}
if ((JSV_ISSTRING(x) || x->type == JS_TNUMBER) && y->type == JS_TOBJECT) {