[Assignment Tracking] Fix replaceVariableLocationOp for dbg.assign with DIArgList
authorOCHyams <orlando.hyams@sony.com>
Tue, 11 Apr 2023 15:56:05 +0000 (16:56 +0100)
committerOCHyams <orlando.hyams@sony.com>
Tue, 11 Apr 2023 16:05:20 +0000 (17:05 +0100)
commitc95b322b738b63abedb0483bafe08b92c3de8e31
treefc9fb20548383961f09abdae34f525bcba2a6cf9
parentb4563ee17ce45728a323c2708e549627b0a8ee9c
[Assignment Tracking] Fix replaceVariableLocationOp for dbg.assign with DIArgList

The last time this function was updated DIArgLists were not supported for
dbg.assigns. Without this patch it's possible to now dereference an invalid
(the end) iterator. This occurs when the Address component gets replaced and
there's a DIArgList for the Value component (the contained values are
irrelevant).

The added unittest crashes without the code change in this patch.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D147922
llvm/lib/IR/IntrinsicInst.cpp
llvm/unittests/IR/DebugInfoTest.cpp