From a258b7e1adb77ecf9183cdff7b0e8a2eaed32d2d Mon Sep 17 00:00:00 2001 From: Kyle Cripps <60898032+kfcripps@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:46:01 -0700 Subject: [PATCH] Fix loc_t operator< when parent is nullptr (#4798) Signed-off-by: Kyle Cripps --- midend/def_use.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midend/def_use.h b/midend/def_use.h index 6708a120dd..ad723717c3 100644 --- a/midend/def_use.h +++ b/midend/def_use.h @@ -66,7 +66,7 @@ class ComputeDefUse : public Inspector, const loc_t *parent; bool operator<(const loc_t &a) const { if (node != a.node) return node->id < a.node->id; - if (!a.parent) return parent != nullptr; + if (!parent || !a.parent) return parent != nullptr; return *parent < *a.parent; } template