From 8d06347a4ba1f135b04e0fc2e2008458cba91774 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 31 May 2021 16:31:45 -0400 Subject: [PATCH] Check that valid bitcasted constant was returned This call returns nullptr to indicate errors. Fixes https://crbug.com/1213365 --- source/opt/folding_rules.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/opt/folding_rules.cpp b/source/opt/folding_rules.cpp index e6add1516b..e3e926c3a5 100644 --- a/source/opt/folding_rules.cpp +++ b/source/opt/folding_rules.cpp @@ -1867,6 +1867,8 @@ FoldingRule BitCastScalarOrVector() { const analysis::Constant* bitcasted_constant = ConvertWordsToNumericScalarOrVectorConstant(const_mgr, words, type); + if (!bitcasted_constant) return false; + auto new_feeder_id = const_mgr->GetDefiningInstruction(bitcasted_constant, inst->type_id()) ->result_id();