Check that valid bitcasted constant was returned (#4311)
This call returns nullptr to indicate errors.
Fixes https://crbug.com/1213365
diff --git a/source/opt/folding_rules.cpp b/source/opt/folding_rules.cpp
index e6add15..e3e926c 100644
--- a/source/opt/folding_rules.cpp
+++ b/source/opt/folding_rules.cpp
@@ -1867,6 +1867,8 @@
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();