| 1309 | } |
| 1310 | |
| 1311 | Expect<void> |
| 1312 | Validator::validateCanonLower(const AST::Component::Canonical &Canon) noexcept { |
| 1313 | const uint32_t FuncIdx = Canon.getIndex(); |
| 1314 | const uint32_t FuncSpaceSize = |
| 1315 | CompCtx.getSortIndexSize(AST::Component::Sort::SortType::Func); |
| 1316 | // 1. Component func index bounds. |
| 1317 | if (FuncIdx >= FuncSpaceSize) { |
| 1318 | spdlog::error(ErrCode::Value::InvalidIndex); |
| 1319 | spdlog::error( |
| 1320 | " canon lower: component func index {} exceeds func index space size {}"sv, |
| 1321 | FuncIdx, FuncSpaceSize); |
| 1322 | spdlog::error(ErrInfo::InfoAST(ASTNodeAttr::Comp_Canonical)); |
| 1323 | return Unexpect(ErrCode::Value::InvalidIndex); |
| 1324 | } |
| 1325 | // 2. Validate canonical options (per-site rules for Lower). |
| 1326 | EXPECTED_TRY(validateCanonOptions(Canon.getOpCode(), Canon.getOptions())); |
| 1327 | // 3. Allocate the resulting core func. Full ABI signature synthesis |
| 1328 | // (flatten_functype for lower) deferred as GAP-C-2b. |
| 1329 | CompCtx.addCoreFunc(); |
| 1330 | return {}; |
| 1331 | } |
| 1332 | |
| 1333 | Expect<void> Validator::validateCanonResourceNew( |
| 1334 | const AST::Component::Canonical &Canon) noexcept { |
nothing calls this directly
no test coverage detected