From 1cc349edc9ca4861fd7ff0c3d6877dd40c528716 Mon Sep 17 00:00:00 2001 From: lxq <877250099@qq.com> Date: Wed, 8 Mar 2023 10:33:42 +0800 Subject: [PATCH] fix a tiny bug --- src/codegen/regalloc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/codegen/regalloc.cpp b/src/codegen/regalloc.cpp index c4bc373..80e5f44 100644 --- a/src/codegen/regalloc.cpp +++ b/src/codegen/regalloc.cpp @@ -36,6 +36,8 @@ RegAllocator::no_reg_alloca(Value *v) { else if (instr->is_zext()) { // only alloca for true use bool alloc; ASSERT_CMPINST_USED_ONCE(instr); + if (instr->get_use_list().size() == 0) + return false; auto use_ins = dynamic_cast( instr->get_use_list().begin()->val_); // assert(use_ins != nullptr && "should only be instruction?"); -- GitLab