From 16969860336ce7f5b39f42371979329e8f1f85b4 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Sun, 29 Sep 2019 06:52:57 +0000 Subject: [PATCH] Bug 933932 - OdinMonkey: provide a better warning message for uncoerced calls (r=bbouvier) UltraBlame original commit: a3ace05661dc27bb6a925017b3f736814fe21318 --- js/src/jit/AsmJS.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/src/jit/AsmJS.cpp b/js/src/jit/AsmJS.cpp index bd07e7a4f1c0b..921005b90fa92 100644 --- a/js/src/jit/AsmJS.cpp +++ b/js/src/jit/AsmJS.cpp @@ -4339,16 +4339,18 @@ CheckExpr(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *type) case PNK_NAME: return CheckVarRef(f, expr, def, type); case PNK_ELEM: return CheckArrayLoad(f, expr, def, type); case PNK_ASSIGN: return CheckAssign(f, expr, def, type); - case PNK_CALL: return f.fail(expr, "non-expression-statement call must be coerced"); case PNK_POS: return CheckPos(f, expr, def, type); case PNK_NOT: return CheckNot(f, expr, def, type); case PNK_NEG: return CheckNeg(f, expr, def, type); case PNK_BITNOT: return CheckBitNot(f, expr, def, type); case PNK_COMMA: return CheckComma(f, expr, def, type); case PNK_CONDITIONAL: return CheckConditional(f, expr, def, type); - case PNK_STAR: return CheckMultiply(f, expr, def, type); + case PNK_CALL: return f.fail(expr, "all function calls must either be ignored (via " + "f(); or comma-expression), coerced to signed " + "(via f()|0) or coerced to double (via +f())"); + case PNK_ADD: case PNK_SUB: return CheckAddOrSub(f, expr, def, type);