From 207df228fc9bcf81d229fe32a689a96dc0ce7f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AF=95=E6=81=A9=E5=87=AF?= <15609889+biankai001@user.noreply.gitee.com> Date: Mon, 13 Apr 2026 23:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/irgen/IRGenExp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/irgen/IRGenExp.cpp b/src/irgen/IRGenExp.cpp index 4001137..9a67446 100644 --- a/src/irgen/IRGenExp.cpp +++ b/src/irgen/IRGenExp.cpp @@ -610,6 +610,10 @@ ir::Value* IRGenImpl::GetLValAddress(SysYParser::LValContext* ctx) { } if (!indices.empty()) { + if (base_ptr->GetType() && base_ptr->GetType()->IsPointer() && + base_ptr->GetType()->GetElementType()->IsPointer()) { + base_ptr = builder_.CreateLoad(base_ptr, module_.GetContext().NextTemp()); + } return builder_.CreateGep(base_ptr, std::move(indices), module_.GetContext().NextTemp()); }