[Flang]Fix another way to crash SimplifyIntrinsics
authorMats Petersson <mats.petersson@arm.com>
Fri, 19 Aug 2022 12:34:48 +0000 (13:34 +0100)
committerMats Petersson <mats.petersson@arm.com>
Fri, 19 Aug 2022 18:00:30 +0000 (19:00 +0100)
commit72e599197c77d95ca2e3c4a7ffe82b739981da75
tree9ff930a6882328c7de352028d31f4f0dd59e618b
parent4579a0224cdcff01b2709501cb5b5d853a471542
[Flang]Fix another way to crash SimplifyIntrinsics

Under some conditions, the defining op may be NULL, so
accept that rahter than try to use it and crash!

Adds test to prevent regression

Fixes github issue #57201

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D132238
flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
flang/test/Transforms/simplifyintrinsics.fir