Skip to content

[P-M5] Parser: test name to identifier conversion unsanitized #7

Closed

Description

@godofecht

Description

parse_test in src/flow/parser.py (line ~901) generates C identifiers from user test names with only space replacement:

name = "test_" + name_token.value[1:-1].replace(" ", "_")

Characters like -, ., !, or non-ASCII produce invalid C/MLIR identifiers downstream.

Fix

Sanitize to [a-zA-Z0-9_] only, replacing or stripping invalid characters.

Audit ID: P-M5

Severity: Medium | Category: Compiler - parser.py

Activity

  1. added
    bug
    on Feb 7, 2026
  2. godofecht commented on Feb 9, 2026

    @godofecht
    ContributorAuthor

    Fixed in 3cea66b. Summary: moved root test_metal into integration; removed empty duplicate test files; added temp-file cleanup in tests; validated string escapes in lexer; added power-of-two
    alignment guards in memory stdlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompilermedium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions