Index: src/asmjs/asm-typer.cc |
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc |
index a98c18b5328d4ae12dc5746130b9a56afeffdfa2..76cdf25456dcdbc578459a9e929ee8e884fa50d3 100644 |
--- a/src/asmjs/asm-typer.cc |
+++ b/src/asmjs/asm-typer.cc |
@@ -1664,6 +1664,12 @@ AsmType* AsmTyper::ValidateNumericLiteral(Literal* literal) { |
return AsmType::Double(); |
} |
+ // The parser collapses expressions like !0 and !123 to true/false. |
+ // We therefore need to permit these as alternate versions of 0 / 1. |
+ if (literal->raw_value()->IsTrue() || literal->raw_value()->IsFalse()) { |
+ return AsmType::Int(); |
+ } |
+ |
uint32_t value; |
if (!literal->value()->ToUint32(&value)) { |
int32_t value; |