Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index ba0fcab3114ca4628d3b354b172c74e4b1a4c73f..eea23c1a5383bf7fca78504dbe9c2039d0217d2d 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8889,10 +8889,20 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize( |
CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); |
HValue* obj = Pop(); |
- ASSERT(arguments->at(kArrayIdArg)->node_type() == AstNode::kLiteral); |
+ if (arguments->at(kArrayIdArg)->node_type() != AstNode::kLiteral) { |
+ // This should never happen in real use, but can happen when fuzzing. |
+ // Just bail out. |
+ Bailout(kNeedSmiLiteral); |
+ return; |
+ } |
Handle<Object> value = |
static_cast<Literal*>(arguments->at(kArrayIdArg))->value(); |
- ASSERT(value->IsSmi()); |
+ if (!value->IsSmi()) { |
+ // This should never happen in real use, but can happen when fuzzing. |
+ // Just bail out. |
+ Bailout(kNeedSmiLiteral); |
+ return; |
+ } |
int array_id = Smi::cast(*value)->value(); |
HValue* buffer; |