deploy-20250820-3 #1

Merged
gh0s7 merged 352 commits from deploy-20250820-3 into master 2025-08-20 21:20:33 +08:00
Showing only changes of commit e48cddab9f - Show all commits

View File

@@ -895,7 +895,7 @@ std::any SysYIRGenerator::visitFuncDef(SysYParser::FuncDefContext *ctx){
currentParamDims.push_back(ConstantInteger::get(-1)); // 标记第一个维度为未知
for (const auto &exp : param->exp()) {
// 访问表达式以获取维度大小,这些维度必须是常量
Value* dimVal = std::any_cast<Value *>(visitExp(exp));
Value* dimVal = computeExp(exp);
// 确保维度是常量整数,否则 buildArrayType 会断言失败
assert(dynamic_cast<ConstantInteger*>(dimVal) && "Array dimension in parameter must be a constant integer!");
currentParamDims.push_back(dimVal);