[GlobalOpt][Evaluator] Fix off by one error in bounds check (PR53002)
authorNikita Popov <npopov@redhat.com>
Wed, 5 Jan 2022 13:05:00 +0000 (14:05 +0100)
committerNikita Popov <npopov@redhat.com>
Wed, 5 Jan 2022 13:06:02 +0000 (14:06 +0100)
commit6e474d330822ee8784d91a7842bba2e7f70b3b79
tree8520e4f8fc19a3877e6056daab12114a39a9afba
parent13992498cd96dcef34cdf1ff02730d266feb0730
[GlobalOpt][Evaluator] Fix off by one error in bounds check (PR53002)

We should bail out if the index is >= the size, not > the size.

Fixes https://github.com/llvm/llvm-project/issues/53002.
llvm/lib/Transforms/Utils/Evaluator.cpp
llvm/test/Transforms/GlobalOpt/pr53002.ll [new file with mode: 0644]