From 9eaa2cb45ba2d6dcabce05682b8e3dbbb28c5a96 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Sun, 12 Mar 2023 14:51:33 -0700 Subject: [PATCH] Fix use-after-move bug in Scope constructor --- src/Scope.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Scope.cc b/src/Scope.cc index d4a2d5f1b5..52dda58033 100644 --- a/src/Scope.cc +++ b/src/Scope.cc @@ -22,7 +22,7 @@ Scope::Scope(IDPtr id, std::unique_ptr> al) { return_type = nullptr; - if ( id ) + if ( scope_id ) { const auto& id_type = scope_id->GetType(); @@ -31,7 +31,7 @@ Scope::Scope(IDPtr id, std::unique_ptr> al) else if ( id_type->Tag() != TYPE_FUNC ) reporter->InternalError("bad scope id"); - FuncType* ft = id->GetType()->AsFuncType(); + FuncType* ft = scope_id->GetType()->AsFuncType(); return_type = ft->Yield(); } }