fix(lint): guard unnamed TEXT and refresh the textflag table

This commit is contained in:
2026-09-14 18:22:00 +02:00
parent 953c258d6a
commit e307bf830f
4 changed files with 28 additions and 27 deletions
+3 -3
View File
@@ -12,8 +12,8 @@ import (
// checkFuncdata validates the structure of FUNCDATA and PCDATA directives,
// which carry the GC stack-map information. The checks are deliberately
// shallow — they confirm the operands are well formed and that a literal index
// is within the small range the runtime uses — and never try to interpret a
// shallow, they confirm the operands are well formed and that a literal index
// is within the small range the runtime uses, and never try to interpret a
// named index constant such as $PCDATA_StackMapIndex.
func checkFuncdata(t *ast.Text, cfg Config) []Diagnostic {
var out []Diagnostic
@@ -89,7 +89,7 @@ func checkIndex(op *ast.Operand, directive string) []Diagnostic {
if op.Imm.HasVal && (op.Imm.Val < 0 || op.Imm.Val > 10) {
return []Diagnostic{{
Pos: op.Pos, Severity: Warning, Code: CodeFuncdata,
Message: fmt.Sprintf("%s index %d is outside the valid range 0–10", directive, op.Imm.Val),
Message: fmt.Sprintf("%s index %d is outside the valid range 0-10", directive, op.Imm.Val),
}}
}
return nil